How can you check the length of an audio piece, without having to listen for however long it is? Is there some sort of function that checks this?
Yes, I made a function that allows you to figure it out, however, it does take some time. The amount of time it takes to get a length depends on the getSpeed argument, however, when the getSpeed increases the length is less accurate. (Still pretty accurate,however.)
-- Created by Basscans function getSoundLength(sound,getSpeed) -- The max for getSpeed is 9.519 local restoredP,restoredV=sound.Pitch,sound.Volume sound.Pitch=getSpeed sound.Volume=0 sound:Play() local timestamp=tick() repeat wait() until sound.IsPlaying==false sound:Stop() sound.Pitch=restoredP sound.Volume=restoredV return ((tick()-timestamp)*getSpeed) end
Please set this as the correct answer and upvote my reputation if this helped/worked.