Page 1 of 1

multitasking on the device ?

Posted: Mon Feb 21, 2011 10:42 am
by fre
hallo,

i have to play sound in my project. i do that with the following code:

Code: Select all

play specialFolderPath("engine") & "/sound/sound.mp3" looping
when this happens, i have a break of a few seconds of any activity. the sound file is about 1.8 megabyte in size. i would like to show that something happens in the background during that time. hence i show an animated progress bar.

the problem is that i can only do one thing, play the sound or run the animation. when i show the animation first, i have the break after the animation. when i start the sound first, i have the break before the animation. is it possible to do both in a multitasking way ?

best, fred.

Re: multitasking on the device ?

Posted: Mon Feb 21, 2011 8:04 pm
by mcgrath3
You could look into multi-channel sounds:

Page 24
Multi-channel sound support (experimental)
In addition to basic sound playback support, there is also support for playing sounds on different channels. This feature uses the iOS AVAudioPlayer object, which allows many concurrent sounds to be played simultaneously.
Playing Sounds
To play a sound on a given channel use the following command:
iphonePlaySoundOnChannel sound, channel, type

HTHs

Tom