playing audio on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
playing audio on Android
Hi,
After reading few posts about problems with playing audio files on Android devices I'm still not sure what should be done.
My tablet is supporting audio formats: AAC, AAC+, AMR-NB, AMR-WB, eAAC+, MP3, OGG, WAV, WMA, AC-3, FLAC. I used a wav file that plays OK in IDE but not in the android standalone.
So I'd like to confirm:
1. If I import the audio file as Control, do I have to Copy Files in the Standalone Application Settings as well?
if yes,
2. Do I have to specify the path for it?
if yes,
3. is the path below correct?
put specialFolderPath("engine") into gPath
and
put this in the handler:
play audioClip file (gPath &"/audio.wav")
keram
After reading few posts about problems with playing audio files on Android devices I'm still not sure what should be done.
My tablet is supporting audio formats: AAC, AAC+, AMR-NB, AMR-WB, eAAC+, MP3, OGG, WAV, WMA, AC-3, FLAC. I used a wav file that plays OK in IDE but not in the android standalone.
So I'd like to confirm:
1. If I import the audio file as Control, do I have to Copy Files in the Standalone Application Settings as well?
if yes,
2. Do I have to specify the path for it?
if yes,
3. is the path below correct?
put specialFolderPath("engine") into gPath
and
put this in the handler:
play audioClip file (gPath &"/audio.wav")
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: playing audio on Android
Hi Keram,
The imported audio controls will not playback when deployed to either iOS and Android. As you have mentioned, you will need to use the "Copy Files" section of your standalone application settings if you wish to include any audio/video within your mobile apps.
Your script is almost correct but you do not need "file" after your play command. Remember to declare your global variable as well.
I have tested the following and the sound plays as expected-
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
The imported audio controls will not playback when deployed to either iOS and Android. As you have mentioned, you will need to use the "Copy Files" section of your standalone application settings if you wish to include any audio/video within your mobile apps.
Your script is almost correct but you do not need "file" after your play command. Remember to declare your global variable as well.
I have tested the following and the sound plays as expected-
Code: Select all
global gPath
on mouseUp
put specialFolderPath("engine") into gPath
play audioClip (gPath &"/audio.wav")
end mouseUp
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
Re: playing audio on Android
Thanks Neil,
Or is the ability to play particular formats in standalones dependent on LC engine as well?
keram
Does it meant that in this case I'm not limited to the use of only audio wav files that LC can play but can use mp3 files that most of the mobiles can play?runrevneil wrote:you will need to use the "Copy Files" section of your standalone application settings if you wish to include any audio/video within your mobile apps.
Or is the ability to play particular formats in standalones dependent on LC engine as well?
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: playing audio on Android
Hi Keram,
With this method you are not limited to WAVS as MP3's will work fine. A list of the media formats that are supported by default on Android can be viewed at the following link-
http://developer.android.com/guide/appe ... rmats.html
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
With this method you are not limited to WAVS as MP3's will work fine. A list of the media formats that are supported by default on Android can be viewed at the following link-
http://developer.android.com/guide/appe ... rmats.html
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
-
- Posts: 192
- Joined: Tue Mar 11, 2014 12:57 pm
Re: playing audio on Android
I got this to work on Android:
by ticking Copy Referenced Files, and the destination folder became _ReferencedFiles
by ticking Copy Referenced Files, and the destination folder became _ReferencedFiles
-
- Posts: 3
- Joined: Mon Nov 09, 2020 7:22 pm
Re: playing audio on Android
HI i know that i replay couple of years later but can i get a test project to learn from? i can't get the audio to work on my device
Re: playing audio on Android
Hi Adam,
welcome to the forum!
Add your sound(s) via the "Copy files" tab in the "Standalone Application Settings".
You will find them in your standalone in -> specialfolderpath("resources")
Best
Klaus
welcome to the forum!
Add your sound(s) via the "Copy files" tab in the "Standalone Application Settings".
You will find them in your standalone in -> specialfolderpath("resources")
Code: Select all
...
play audioClip (specialfolderpath("resources") &"/your_audio.wav")
...
Klaus