Page 1 of 1
How to play mp3 sounds in android with Livecode?
Posted: Tue Oct 22, 2019 10:15 pm
by Fasasoftware
How to play mp3 sounds in android with Livecode?
If i put this code....i hear sound in my android phone....
Code: Select all
global gPath
on mouseUp
put specialFolderPath("engine") into gPath
play audioClip (gPath &"/Cow.wav")
end mouseUp
buti if i put this....this code don't work....I need my sounds played in MP3... the sounds don't work..
Code: Select all
global gPath
on mouseUp
put specialFolderPath("engine") into gPath
play audioClip (gPath &"/Cow.mp3")
end mouseUp
Can somebody help me please???? best regards, Lestroso

Re: How to play mp3 sounds in android with Livecode?
Posted: Tue Oct 22, 2019 10:24 pm
by bogs
Sorry Lestroso, I don't think you can play mp3's in Lc
Cyril's page seems to say different, though.
Code: Select all
on mouseUp
play "firecracker.wav"
end mouseUp
So maybe it is as simple as removing 'audioclip' from your line? The BYU also suggests that to play an mp3, you'd use the player object, give it a shot

Re: How to play mp3 sounds in android with Livecode?
Posted: Wed Oct 23, 2019 9:21 am
by Klaus
Hi Lestroso,
MP3 files should also play on Android, however you should try the official syntax for MOBILE,
which is different from the syntax for desktop, please always check the dictionary when in doubt!
Code: Select all
global gPath
on mouseUp
put specialFolderPath("resources") into gPath
play soundfile (gPath &"/Cow.mp3")
end mouseUp
Hint:
Get used to use ->
specialfolderpath("resources") instead of specialfolderpath("engine")
This happens to be the same folder on the mobile platform, but "resources" does also work on the desktop and in the IDE!
In the IDE it points to the folder where the current stack is in.
Best
Klaus
P.S.
Imported sounds are NOT supported on the mobile platform!
Re: How to play mp3 sounds in android with Livecode?
Posted: Wed Oct 23, 2019 6:31 pm
by Fasasoftware
Dear friends, bogs and klaus.....
Thanks you for your answer.... i have tested this problem....with success....
I'm be able to play sounds MP3 files in my android app and works fine!!
ok the code working is this...:
Code: Select all
global gPath
on mouseUp
put specialFolderPath("resources") into gPath
play audioClip (gPath &"/Cow.mp3")
end mouseUp
You must use specialfolderpath("resources") , here the example here up on the top... instead of specialfolderpath("engine") that you must setup when you enclose your sounds in the panel "STANDALONE APPLICATION SETTINGS in the "Copyfiles" section!!!!
In my case ... i have had include my sound file as a direct path...for example..so: /Users/lestroso/Desktop/toesounds/Cat.mp3
Works Fine!!!!
I hope this help you...best regards, Lestroso
