Hello,
I want to play 4 sounds right after one another. I have this code:
put (specialFolderPath("engine")) into tPath
put "/1-ivy.wav" into tfile
play audioClip tPath & tFile
wait until the sound is done
put tPath & "/2-ivy.wav" into tFile
mobilePlaySoundOnChannel tFile, "two", "now"
put tPath & "/3-ivy.wav" into tFile
mobilePlaySoundOnChannel tFile, "two", "next"
put tPath & "/4-ivy.wav" into tFile
mobilePlaySoundOnChannel tFile, "two", "next"
I expect to hear "1-2-3-4", but I hear "1-2-4". Could you please tell me why?
Thanks, Natalie
"next"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: "next"
Hi Natalie,
Does 3-ivy.wav play on iOS at all? Are you sure there isn't a problem with the file format? For example, compressed WAV files may not play in LiveCode.
You could try this:
This script will continue to play the sounds forever. You could add a line that exits without playing another sound if lCounter = 4 or you could not call the playSounds handler again when the hilite of a checkbox is true for instance. I use twox instead of two because I don't know whether problems can arise if numbers are used as sound channel names.
Kind regards,
Mark
Does 3-ivy.wav play on iOS at all? Are you sure there isn't a problem with the file format? For example, compressed WAV files may not play in LiveCode.
You could try this:
Code: Select all
local lCounter
on playSounds
if lCounter is empty or lCounter > 4 then put 1 into lCounter
put lCounter & "-ivy.wav" into myFile
mobilePlaySoundOnChannel myFile,"twox","now"
add 1 to lCounter
end playSounds
on soundFinishedOnChannel
playSounds
end soundFinishedOnChannel
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: "next"
Thanks, Mark. The sound 3-ivy.wav is a good file. It plays fine, when I'm not using "next".
I implemented your code, and it works. But your solution doesn't really address how to use the "next" parameter properly. Is this a bug? Am I using the call improperly? According to the Dictionary, this is supped to work.
=Natalie
I implemented your code, and it works. But your solution doesn't really address how to use the "next" parameter properly. Is this a bug? Am I using the call improperly? According to the Dictionary, this is supped to work.
=Natalie
Re: "next"
Hi Natalie,
It might be a bug. I don't know. You could file a bug report and find out.
Kind regards,
Mark
It might be a bug. I don't know. You could file a bug report and find out.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode