multitasking on the device ?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
fre
Posts: 41
Joined: Fri Nov 12, 2010 7:22 pm

multitasking on the device ?

Post by fre » Mon Feb 21, 2011 10:42 am

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.

mcgrath3
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 149
Joined: Thu Feb 23, 2006 8:49 pm
Contact:

Re: multitasking on the device ?

Post by mcgrath3 » Mon Feb 21, 2011 8:04 pm

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
Tom McGrath III
Lazy River Software
3mcgrath@comcast.net

Post Reply