Page 1 of 1
Audio Issues
Posted: Fri Jul 08, 2011 3:38 pm
by unclewayne
I have a game that has a constant background music and different audio clips for different actions. Right now I have "play (specialfolderpath("engine") & "/sounds/buzz1.mp3")" on openCard and "play (specialfolderpath("engine") & "/sounds/buzz2.mp3") assigned to an intersect. When the intersect happens it plays the correct audio file, but stops the background music. So my questions are:
1) how do i get the background music to loop until the card is closed?
2) how do i get the intersect audio to play with out stopping the background audio?
3) Is it possible to make the iphone vibrate on the intersect?
I am almost doen with this project and any help on these last little steps would be awesome!
Re: Audio Issues
Posted: Fri Jul 08, 2011 4:17 pm
by Klaus
Hi Wayne,
please check the "iOS Release Notes" for "Multi-channel sound support"!
This has been added some time ago and does what it says
I did not work with this feature yet, but the syntax looks pretty straightforward!
There is an example stack in LiveCode: select menu: Help > Example Stacks and Resources
The stack can be found at: Mobile Examples/Sound Example.livecode
Best
Klaus
Re: Audio Issues
Posted: Fri Jul 08, 2011 6:47 pm
by unclewayne
Klaus,
I tried that and i am still having a tough time getting it to work. This is what i added to the card script:
on setBackgroundSound pSound
iphonePlaySoundOnChannel (specialfolderpath("engine") & "/sounds/buzz1.mp3"), "Background", "looping"
end setBackgroundSound.
What am i doing wrong?
Also any info on the vibrate?
Thanks.
Re: Audio Issues
Posted: Fri Jul 08, 2011 6:58 pm
by Klaus
Hi Wayne,
syntax looks OK!?
Try to create the path to the sound first and use that as a param and maybe try to use a number for the sound channel,
although it should work the way you scripted it.
Code: Select all
on setBackgroundSound pSound
put (specialfolderpath("engine") & "/sounds/buzz1.mp3") into tSoundFile
iphonePlaySoundOnChannel tSoundFile,1,"looping"
end setBackgroundSound
Are you using the latest release of LiveCode?
Best
Klaus
Re: Audio Issues
Posted: Fri Jul 08, 2011 6:58 pm
by Klaus
P.S. Vibrating not (yet?) supported!