New LSL float llGetSoundLength(string name);
tracked
dantia Gothly
We have no way to know how long sounds are in our inventory in the sound properties or in LSL. We need the ability to see how long sound files are.
Having this function would be great for making sure we can queue the next sound properly. this would be ideal for song loopers when we have a lot of sound files we're handling that have differing lengths.
llSetSoundQueueing is limited and does not offer anything more than 1 level deep and will discard the last sound your trying to queue, so that isn't useful.
Log In
Maestro Linden
tracked
Signal Linden
This would be amazingly useful for some obvious reasons (Sequencing sounds, etc.) It's one of those "easy ask, not completely easy to implement" ideas because there's no general backend system for storing metadata about assets. Crudest implementation would be to load the sound server side, in part or in whole, to get the duration. That's doable, but... seems potentially expensive considering we just want the duration. We could implement a system for storing asset metadata, but SL has a gosh darn lot of assets. :)
Kathrine Jansma
SL might have a lot of assets, but most will never be asked for that metadata.
So something like an RDF/Turtle (https://en.wikipedia.org/wiki/Turtle_(syntax) ) database that caches/collects the metadata in a lazy way would be a way to do that. Then you only pay for the data thats actually being asked. The latency price payed on first non-cached access should be negligable.
Coffee Pancake
why wasn't this a thing from the very start.
Bleuhazenfurfle Resident
There's also llRequestInventoryData which already exists, and is weirdly underutilised. Define it as returning CSV info (there's existing precedent), and this can also include animation length/strength, texture aspect ratio, object component count, and so on. There's a bunch we need to be able to get information on.
And it'll need to be a dataserver request anyhow, since the simulator has no other reason to fetch the audio, or know it's length (these things are completely viewer-side), and it may not be in the objects inventory (llRequestInventoryData should be extended to accept keys).