Page 1 of 1

Playing sound files on Linux

Posted: Fri Jan 12, 2018 2:32 pm
by félix
Hi,

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
Félix

Re: Playing sound files on Linux

Posted: Fri Jan 12, 2018 3:07 pm
by bogs
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.

Re: Playing sound files on Linux

Posted: Fri Jan 12, 2018 3:23 pm
by Klaus
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.

Best

Klaus