Check if an audio is content deleted or not?

I am creating a club/dance game and I was wondering how I can detect if an audio is content deleted or not?

A lot of audios that have been removed from the website don’t get their name changed, so I can’t directly compare the audio name with “[ Content Deleted ]”.

I considered setting a sound object’s audio ID to the audio I am trying to check out and wait to see if the sound length ever goes above 0, but I felt like that would add an unnecessary wait between the end of one song and the beginning of another.

Does anyone have any thoughts on this?

2 Likes

You would have to place the audio in the game, and use the “Test” feature in Studio. This would check if anything is playing, or if the audio is inappropriate.

How would I do this? Are you talking about manually testing each audio?
If you are, that is quite inefficient and I would have to preform that on 100s of songs on a regular basis.
Have you any idea how to do this with a script?

If its just that their name is [ Content Deleted ], you could read the name of the audio.

You could use :GetProductInfo(productID).

I know how to script the audio, but with patience it would work. You could always just put the audio under Workspace, and turning on “playing”

No.

I’m not sure if there’s any efficient way of doing this. As ArtFoundation said 2 posts ago, you can just do :GetProductInfo(productID) as it is the best method you can use for your use case.

This is not quite what I am looking for. If a sound ID fails to play, I want my script to skip the song.

Use pcall(). For example:

bool = pcall("print('hi')")
if bool == true:
   -- Do something here
elseif bool == false
   -- Do something here

Do you know how edits work?

And when a sound ID fails to load I don’t think it gives an error. Just a message in output.

I in fact, was midway of writing my edit. But I had to go do something. Now I won’t even bother finishing it, probably going to delete my post.

Now to the point, trying doesn’t hurt. In my opinion, it should work. Doesn’t hurt to try, does it. But yeah.

It hurts to try if I have tons to do and I already know it won’t work.