Problem: When sound is played twice, it gets louder.
In a quiz, user touches Start to hear the current question, an aiff held in variable currQ. Sound is played. User has option to repeat the sound by touching Repeat button. EventListeners below:
[code] --Start button code function newQuestion(e) if (e.phase == "began") then start\_down\_btn.alpha = 1; end if (e.phase == "moved") then start\_down\_btn.alpha = 0; end if (e.phase == "ended") then start\_down\_btn.alpha = 0; audio.play(currQ);--current question sound end return true; end --Repeat button code function repeatQuestion(e) if (e.phase == "began") then repeat\_down\_btn.alpha = 1; end if (e.phase == "moved") then repeat\_down\_btn.alpha = 0; end if (e.phase == "ended") then repeat\_down\_btn.alpha = 0; audio.play(currQ);--current question sound end return true; end [/code]
Is there a quick way to clear and re-insert currQ sound between press of Start and Repeat buttons?
I’ve tried setting currQ to nil after first play and putting the repeat sound in a different variable. I assume that it’s somehow addressing 2 instances of the sound, and playing them simultaneously. Sound gets louder on the first press of Repeat button, but doesn’t continue to get any louder on subsequent presses.
App reverts to the original volume when it plays the answer which, in this case, points to the same aiff file with a different object name. I can test creating a separate set of objects for repeat call, but think there’s a better answer.
Thanks for any help that you can give.
LB