Playing sound files on Linux

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: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Playing sound files on Linux

Post by félix » Fri Jan 12, 2018 2:32 pm


One big thing that attracted me to LC is the ability to code for Linux. So far it went very well. The feature I'm having problem now is playing sounds.

I have a simple stack, that plays well under Windows. Very simple stuff: I have imported the sound file, one MP3 and one WAV with the menu File..Import As Control .. Audio file

The code is simple too:
play "oops.wav"
play "magic.mp3"

I know that the MP3 is not supported on Windows. It just make some noise. The WAV plays fine.
But on Linux no sound, no error for both.

Is there another way to do it ?

Thanks in advance

Posts: 2306
Joined: Sat Feb 25, 2017 10:45 pm

Re: Playing sound files on Linux

Post by bogs » Fri Jan 12, 2018 3:07 pm

According to the dictionary, audio clips can be in WAV, AIFF, or AU format. I believe for linux you also need mplayer, but could be wrong (I don't do much with sound).

I can refer you to this lesson.

Posts: 10420
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Playing sound files on Linux

Post by Klaus » Fri Jan 12, 2018 3:23 pm

Bonjour Félix,

some more hints:
1. Check "the result" after the PLAY command

Code: Select all

play "oops.wav"
if the result <> EMPTY then
  anser "Error:" && the result
end if
This may give us a hint what is going wrong.

2. Do only use UNCOMPRESSED WAV and AIF files!
LC does not like compressed sounds UNLESS in AU format, which is compressed by nature.



Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”