Option to allow scene audio to either loop or play once...same for sound emitters...
10 comments
-
Torley - Sansar We'll gain more control over audio playback — including one-shot sounds — with forthcoming audio scripting support... stay tuned!
-
Agustine Fantastic... cheers!
-
Luis Sotillos Hi! Is there any news regarding this topic? I'm trying to get and audio emitter with no loop (just one time shot), but I can't find the option... any suggestion please?
Cheers
-
Agustine Still not supported yet, but its coming...hang in there..
-
Torley - Sansar It's supported. You can now use a script to trigger one-shots, depending on what you are trying to accomplish? Are you trying to have a non-looped sound play once depending on a specific event?
For example, https://help.sansar.com/hc/en-us/articles/115003263206-Example-Script-Sound-Randomizer can use sounds that are not loops.
And check out https://help.sansar.com/hc/en-us/community/posts/115018117163-Colaborative-Keyboard-Music-Experience-WIP- :)
More "hooks" to connect sounds to events will be coming, like when we get more robust networked physics support, collisions can trigger sounds.
-
Galen I have one-shots in my door script for open and close events.
// User-editable setting
public SoundResource OpenSound;
...
if (OpenSound != null) {
ScenePrivate.PlaySound(OpenSound, PlaySettings.PlayOnce);
} -
Agustine ..So with these scripts we don't need to use the built in Audio? I was referring to...
-
Luis Sotillos Torley, thanks for your info. I'm trying to trigger a one-shot-sound (no loop) when the user/avatar gets near an object or enter a zone. Please, anybody has an example of this kind of script?
Thanks in advance for your help.
Cheers
-
Luis Sotillos Galen, thanks for your message, I'l try to study your great scripts I've seen in the store, thanks a lot!
-
regomatic That is correct, you can leave the "background sound" fields off and just trigger from scripts.
NOTE: Scripted sounds are synched by default, so people who join later will hear the sound from the elapsed time (or they will hear nothing if it's a one-shot and the duration has already elapsed). If you want everyone to hear a sound in its entirety -regardless of when they joined-, make sure to create your own PlaySettings object and set its DontSync field to true.