Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Help

foxy72727
Registered User
Quote
2022-07-19 01:32:01

So I'm making a siren head game, and when i play a sound it just overlaps with the same sound. (ex. the sound plays but 2 seconds later it plays again without the other one stopping)


Arcanjo
Guest
Quote
2022-07-19 08:09:25




veganpete
Registered User
Quote
2022-07-19 08:20:31

Depending on how you're triggering the sound, it could be the "key-repeat" setting in Windows that's making it re-trigger the sound every few milliseconds or is being re-triggered by an "every few seconds" or "on proximity" coppercube instruction, depending how you've made your game. Also make sure that the sound "looped?" option is unchecked for any "one-shot" sounds.

In any case, to prevent it overlapping you can either turn off "Key-repeat" in Windows settings - or you can use the following example to control the sound using variable flags....

If Variable "sound" =0,
Play Sound "sound.wav",
Set Variable "sound" =1
This will only play the sound if the variable =0 (sound not already playing)

When you stop the sound, do this:
Stop Sound "sound.wav",
Set Variable "sound" =0
This will allow the sound to be played again when required.


okeoke
Registered User
Quote
2022-07-19 09:25:00

I actually have a similar question.

Do you guys know any reliable way to play 3d sound programmatically?

I have a 3d mesh and its child 3d sound node. Parent node has a js behavior attached to it. I'm trying to trigger the child 3d sound node to play the sound from this behavior.
Currently, my approach is to change playmode to "nothing" and then to "play_once". The issue is that it doesn't always work for me. My theory it should be done on the different frames, i.e. frame 1 - set to "nothing", frame 2 - set to "play_once".


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (you are not logged in)


Text:

 

  

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


   






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