AssetService:SearchAudio() returns data that you cannot reproduce

I didn’t check other assets, I just noticed the one since it was causing errors and made a temporary fix for it

Hey! I just took a look and looks like the sound 7524653769 still does not have a Title field.

I can reproduce the title being missing for that asset. I think this time I figured out the root cause for this issue and will be deploying a fix later today. Sorry for the inconvenience this has caused you and thanks for reporting this bug.

I’ll update this thread when I deploy my changes.

2 Likes

This should be fixed now. Please let me know if there are any more issues.

2 Likes

Hey! I was wondering if there were plans to correct the Duration field for results. I’ve noticed that if you try to request data for an audio that’s < 1 second, it will provide an inaccurate result which in our specific case breaks multiple of our systems.

for reference if you try to get the results for the asset 12221967 it will provide:

{
    [1] =  ▼  {
        ["Artist"] = "Roblox",
        ["AssetId"] = "12221967",
        ["AudioType"] = SoundEffect,
        ["Duration"] = 0,
        ["Title"] = "button.wav"
    }
}

However, if you load the sound itself you can see that the duration is really 0.293

image

This is specifically an issue in Clip It where we need to guaruntee the actual duration of an audio to properly display it in our timeline for users making clips. I also do not think it should be the developers problem to deal with since we are supposed to have an API to deal with this ourselves and it is extremely frustrating to constantly have to be battling with this API.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hi @pashleyy,

The Duration field is rounded to the nearest second. So for asset 12221967 which has a true length of 0.293 we will store 0 as. the Duration.

To get an accurate duration I would recommend loading the audio asset using the Sound or AudioPlayer instances and using their TimeLength property to get the duration. Is there something that prevents you from doing that in your experience?

No, this definitely does work. However it is a nightmare having to do this when loading hundreds of audios

1 Like

In Clip It specifically, we’re loading hundreds of results all in a quick timeframe and also are trying to avoid loading all the audios into memory (which happens when you do this method) because of the low memory limit on mobile devices. So although this does work, it is not a viable solution for us and other user-generated content-type experiences.

1 Like

Doing this is going to be very bad on weaker internet connections and also evict actually important things from the content cache. It also can’t easily be cached, whereas Roblox should be able to cache that data for all users significantly easier.

1 Like

Thanks for the feedback! Could one of you create a new bug for the Duration rounding so we can track progress on it?

1 Like
1 Like

Duration starting today as of January 29th, it is printing Nil, I ran several tests to check it 4 times with no mistake. It keeps printing nil and causing every Roblox game that uses a music system to search for the duration number value and may break it since this API is currently down or partially not working as of 6 hours ago.

Now the the entire value of “Duration” is not responding at all as of 6 hours ago, and still persisting to not function at all and prints “Nil”. This damaged several systems that check for duration. This appears to be a Roblox issue, no matter how many times as a developer I try to call the “Duration” value, it never appears, and the game defaults to it being “nil”

I am referring to GetAudioMetadataAsync() btw, idk if I need to open another thread for this, but this bug is really bad right now, and it’s impacting every Roblox game that uses this function.

I’ll look into the duration issue, thanks for bringing it to my attention

I don’t know if you’ve already found a workaround or not, but you can create a new sound instance and give it the sound ID you need the duration of (parent it to workspace). Should be able to get the duration from there.

A fix has been found and will go out next week with version 659. Unfortunately due to the nature of this bug it cannot be reverted in this week’s version 658. In the mean time please use @BurningEuphoria’s workaround or the Duration value from AssetService:SearchAudio.

Sorry for any inconvenience this has caused. I identified a couple of issues in the process of releasing this change that I will work to correct for future changes to prevent these issues in the future.