More API for Sounds

At the BA Makerfaire I brought up the ideas for having a .length method of a sound, as well as being able to start playing at whatever length. I suggested this to David Baszucki, Simon, and Stravant. It must be really hard to implement because it’s definitely a needed feature and isn’t done yet.

Visual studio should have some built in APIs for measuring the length of a sound.
It would at least be significantly easier than to parse the headers of a raw mp3 file in lua.

1 Like

Some of the things you guys are asking for were done at one point but withdrawn since a non-sound patch hadn’t gone out yet. I just haven’t had a chance to get back into the sound engine too much to fix up any remaining issues and add some new features.

Please note that as far as being able to get the length of sound files and things like that, you will only be able to do that on the client side when those features becomes available. We use FMOD on the client side and do not do it on the server. Therefore, there is no immediate plan to allow proper sound lengths or accurate isPlaying information from the server.

isPlaying is already there and should be working correctly on the client side. Again, this is because we use FMOD on the client side, which has absolute knowledge of whether or not the sound file is playing on your system. However, the server doesn’t have access to this information; so, unless your script says to stop playing a sound after a given period of time (by programming that bit of info into your script code), the server is going to continue thinking it’s playing, since it has no concept of how long the audio file is.

Audio scrubbing is something that kind of already exists somewhere in our code, but it just hasn’t been rolled out yet.

Regardless, I’m working to get some of these features pushed out now that an earlier non-sound problem has long-since been resolved.