Playing Multiple Audio Tracks Simultaneously

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vcirilli
Posts: 12
Joined: Sat Sep 03, 2022 7:58 pm

Playing Multiple Audio Tracks Simultaneously

Post by vcirilli »

Is it possible to have multiple audio files playing at the same time.
Ex. Background music playing while a dialog track plays at the same time.
I've tried Play audioClip and Play File.
Both replace the previously playing file.
Working on Mac at the moment but eventually would like to build for Android/IOS

Thank Vincent
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Playing Multiple Audio Tracks Simultaneously

Post by richmond62 »

I think you have already answered your question yourself.
vcirilli
Posts: 12
Joined: Sat Sep 03, 2022 7:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by vcirilli »

Yes I found the documentation that states that.

Evidently a LC limitation, bummer.
Might there be a plugin to help with playing multiple audio tracks?
SparkOut
Posts: 2987
Joined: Sun Sep 23, 2007 4:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by SparkOut »

Uh... what documentation did you read?

You can't play embeded audioclips simultaneously, that I believe.
You can't simultaneously play two files in one Player object, but you can easily have multiple Player objects with different filenames playing at the same time. You just have to reference each one individually.
vcirilli
Posts: 12
Joined: Sat Sep 03, 2022 7:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by vcirilli »

I was using Play audioClip.
Player Object !! Thanks
vcirilli
Posts: 12
Joined: Sat Sep 03, 2022 7:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by vcirilli »

Player doesn't work on Android.
SparkOut
Posts: 2987
Joined: Sun Sep 23, 2007 4:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by SparkOut »

Yes it does, but you have to create the object dynamically.
See mobileControlCreate in the dictionary. You have to create and manage these controls by script on opening a card and delete them again when you change card, or else they will stay open over the new card, which might interfere with the layout.
vcirilli
Posts: 12
Joined: Sat Sep 03, 2022 7:58 pm

Re: Playing Multiple Audio Tracks Simultaneously

Post by vcirilli »

Ok I see thanks.
Post Reply