We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Sounds repetition
Page Index Toggle Pages: 1
Sounds repetition (Read 797 times)
Sounds repetition
Jun 13th, 2009, 7:42pm
 
hi,

i created sounds for a programm, that always apears when some objects near to other.

I created a globale variable that starts with the value 0.

Only if the variable is 0 and the objects are near to each other the sound trigger is called and the sound is playing.

After playing the sound trigger i set the variable to 1, so it wont repeat. I set it againg to 0 if the objects are far away from each other.

the problem i have recognized is, that sometimes the sound files are playing 2 times.

how could this be? i set the counter after playing immideatly to 1 so the condition for calling the trigger is not filled.

As far as i seen now the bug only exists if the soundfiles are very short, but im not sure.

Re: Sounds repetition
Reply #1 - Jun 14th, 2009, 4:01am
 
how are you working out if things are near to one another?

add some debug so it prints out the names of the two things that are close to one another just before it plays the sound.
Re: Sounds repetition
Reply #2 - Jun 14th, 2009, 7:28am
 
in this case its working fine, but i still have the bugs.
Re: Sounds repetition
Reply #3 - Jun 14th, 2009, 7:31am
 
It sounds like the program begins to play a sound, stop at the middle and plays the sound again.

is there a possibliity to say: dont play another sound before one is finished?
Re: Sounds repetition
Reply #4 - Jun 14th, 2009, 8:23am
 
If your using minim, this may be an issue with the library itself.  See this thread which describes a stuttering bug: http://processing.org/discourse/yabb2/num_1175037473_15.html

One posters stated that he overcame the issue by changing to the Ess library.
Re: Sounds repetition
Reply #5 - Jun 14th, 2009, 8:41am
 
Ok, thank you for the info this sounds bad Sad


It would be nice if anybody can tell me possibillitys to say the programm, that it doesnt have to play another soundfile if the file before istn finished and the command to make a sound stop.

this would maybe still an improvement.
Page Index Toggle Pages: 1