Audio Issues

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
unclewayne
Posts: 37
Joined: Tue Apr 05, 2011 9:58 pm

Audio Issues

Post by unclewayne » Fri Jul 08, 2011 3:38 pm

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!

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Audio Issues

Post by Klaus » Fri Jul 08, 2011 4:17 pm

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 :D

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

unclewayne
Posts: 37
Joined: Tue Apr 05, 2011 9:58 pm

Re: Audio Issues

Post by unclewayne » Fri Jul 08, 2011 6:47 pm

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.

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Audio Issues

Post by Klaus » Fri Jul 08, 2011 6:58 pm

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

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Audio Issues

Post by Klaus » Fri Jul 08, 2011 6:58 pm

P.S. Vibrating not (yet?) supported!

Post Reply