ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator Is there a way to loop sound when using an external sound file?
person icon
guest_edkeyte
Guest
Quote
Yesterday

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

if (typeof this._played === "undefined") {
this._played = true;
ccbPlaySound("sound/test.wav");
}


person icon
dekon_17
Registered User
Quote
Yesterday

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:
...
if (!this._played){
this._played = true;
ccbSetSceneNodeProperty (ccbGetSceneNodeFromName ([sound node name]), 'SoundFileName', "sound/test.wav");
}
...

Had to use something like that myself, due to the fact that you can't control sound volume and play mode of a ccbPlaySound.

person icon
guest_edkeyte
Guest
Quote
Today

That's excellent. Thank you so much. Really, really helpful.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |