Play MP3 - What format do you use for mobile?

Mark Waddingham mark at livecode.com
Mon Aug 8 05:00:06 EDT 2016


On 2016-08-08 10:39, Devin Asay wrote:
> MP3s play natively on both iOS and android. You should be able to use
> the play command followed by the path to the file. Or is the issue
> that you need to have it cross platform? In that case WAV is a good
> choice.

Devin is correct - the 'play' command should work on iOS and Android 
with mp3s. For the desktop platforms, you are best to use a hidden 
player. This can be abstracted with a command in a library script - 
which 'does the right thing' on all platforms. i.e.

command playSound pSoundFile
   if the environment is "mobile" then
     play pSoundFile
   else
     set the filename of player "myHiddenPlayer" to pSoundFile
     play player "myHiddenPlayer"
   end if
end playSound

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the Use-livecode mailing list