Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Is there a way to loop sound when using an external sound file? Eg like this but with a way to loop the sound: // Play sound when entering the zone |
||||
|
Don't think it's possible with this command. However, you can do something else, although it will be a bit more complex. Instead of using ccbPlaySound, add a sound node, and, when you need to play that external sound, do something like this: ... Had to use something like that myself, due to the fact that you can't control sound volume and play mode of a ccbPlaySound. |
||||
|
That's excellent. Thank you so much. Really, really helpful. |
||||
|
You can use this type of code: get fixed 3D sound node - "SndVoiceN" var vol = 80; // change volume as you like when playing also var snd = "data/music.ogg"; ccbSetSceneNodeProperty(SndVoiceN, "PlayMode", "nothing"); ccbSetSceneNodeProperty(SndVoiceN, "SoundFileName", snd); ccbSetSceneNodeProperty(SndVoiceN, "Volume", vol); ccbSetSceneNodeProperty(SndVoiceN,"PlayMode","play_once"); can change from "play_once" to "looping" to keep playing. |
||||
|
|