Page 1 of 1
Play an audio clip in Android with LC? - Solved
Posted: Fri Sep 20, 2013 12:09 am
by DR White
I read a few posts and look around at the limited documentation on LC audio
and it sounds like this might be a weak area for LC.
So I have a game that I play an audio clip on certain events and
want to know the Best way to play an audio clip in LC (in an Android environment)?
Thanks,
David
Re: What is the Best way to play an audio clip in LC?
Posted: Fri Sep 20, 2013 10:48 am
by Klaus
Hi David,
on Android you do not have that many choices for this
...
play path_to_soundFile
...
Make sure to use the correct sound format for Android.
On mobile the "play" command is not limited to the engine
capabilities of Livecode but the supported formats of the target
platform.
Check this:
http://developer.android.com/guide/appe ... rmats.html
Best
Klaus
Re: What is the Best way to play an audio clip in LC?
Posted: Fri Sep 20, 2013 11:11 am
by DR White
Klaus,
I am leaving for work now and will checkout the link latter today.
Would it be possible for you to attach an example stack playing
a sound file, volume control and sound on/off utilizing this method?
Thanks,
David
Re: What is the Best way to play an audio clip in LC?
Posted: Fri Sep 20, 2013 11:29 am
by Klaus
Hi David,
I do not develop for Android, so please refer to the docs for this:
http://livecode.com/developers/guides/m ... -features/
Scroll to -> Basic Sound Playback Support
I saw that "mobilePlaySoundOnChannel" is also supported on Android, this will give you more control over your sounds than the "simple" play.
Best
Klaus
Re: What is the Best way to play an audio clip in LC?
Posted: Fri Sep 20, 2013 3:10 pm
by DR White
Klaus,
Thanks for the reference links,
David
Re: What is the Best way to play an audio clip in LC?
Posted: Fri Sep 20, 2013 5:40 pm
by DR White
So far, I have had no success playing a sound clip in Android with LC.
Some sample code would be very much appreciated.
Thanks,
David
Re: Play an audio clip in Android with LC? - Solved
Posted: Fri Sep 20, 2013 10:10 pm
by DR White
Problem Solved!
Please see the post of:
jacque ยป Fri Sep 20, 2013 12:19 pm
Under "Android Development", the topic :
How to use "mobilePlaySoundOnChannel"
Re: Play an audio clip in Android with LC? - Solved
Posted: Sat Sep 21, 2013 10:49 am
by Klaus
And it's even in the dictionary with examples!

Re: Play an audio clip in Android with LC? - Solved
Posted: Sat Sep 21, 2013 1:08 pm
by DR White
Klaus,
I tried the exact examples in the dictionary for both "Play" and "mobilePlaySoundOnChannel", plus several variations.
I could not get either to work as they appeared in the dictionary, in an android environment.
I believe without the word "engine" as part of the path that Jacque brought to light, the odds of working were slim.
As always Klaus, Thanks for your help,
David