Discussion:
Playing .WAV files on Linux
(too old to reply)
Scott Lacy Smith
2004-04-07 05:40:01 UTC
Permalink
Hello
I am looking for the Linux equivalent of
waveOutOpen()
waveOutWrite()
These are Win32 calls to let you play wav file on windows.
In general what is the preferred API to play wave files on Linux.
waveOutOpen and waveOutWrite are not really for playing wav files,
they are how you interface to the sound system on Windows.

On many Linux/Unix systems the sound device appears as a file you
open for writing:

fp = fopen("/dev/dsp", "w");
...
fwrite(..., fp);
...
fclose(fp);
--
Scott Lacy Smith <***@qwest.net>
"Nullus Anxietas"
Jan Panteltje
2004-04-07 16:36:11 UTC
Permalink
On a sunny day (Wed, 07 Apr 2004 05:40:01 GMT) it happened Scott Lacy Smith
Post by Scott Lacy Smith
Hello
I am looking for the Linux equivalent of
waveOutOpen()
waveOutWrite()
These are Win32 calls to let you play wav file on windows.
In general what is the preferred API to play wave files on Linux.
waveOutOpen and waveOutWrite are not really for playing wav files,
they are how you interface to the sound system on Windows.
On many Linux/Unix systems the sound device appears as a file you
fp = fopen("/dev/dsp", "w");
...
fwrite(..., fp);
...
fclose(fp);
--
"Nullus Anxietas"
Coming to think about it, cat xxx.wav | edscat will also work, but only
for 44100 samples/s it seems.
JP
Will
2004-04-11 22:29:30 UTC
Permalink
Post by Jan Panteltje
On a sunny day (Wed, 07 Apr 2004 05:40:01 GMT) it happened Scott Lacy Smith
Post by Scott Lacy Smith
Hello
I am looking for the Linux equivalent of
waveOutOpen()
waveOutWrite()
These are Win32 calls to let you play wav file on windows.
In general what is the preferred API to play wave files on Linux.
waveOutOpen and waveOutWrite are not really for playing wav files,
they are how you interface to the sound system on Windows.
On many Linux/Unix systems the sound device appears as a file you
fp = fopen("/dev/dsp", "w");
...
fwrite(..., fp);
...
fclose(fp);
--
"Nullus Anxietas"
Coming to think about it, cat xxx.wav | edscat will also work, but only
for 44100 samples/s it seems.
JP
Thank you all who gave input to playing sound on Linux. Since my application
already used SDL for graphics, I think I will also use SDL for sound.
Mikko Rauhala
2004-04-12 01:01:08 UTC
Permalink
Post by Will
Thank you all who gave input to playing sound on Linux. Since my application
already used SDL for graphics, I think I will also use SDL for sound.
Ah. Since this is the case, it's certainly among the better options for
simple playback. At least you won't have to worry about any extra
portability or dependency issues.
--
Mikko Rauhala - ***@iki.fi - <URL:http://www.iki.fi/mjr/>
Transhumanist - WTA member - <URL:http://www.transhumanism.org/>
Singularitarian - SIAI supporter - <URL:http://www.singinst.org/>
Loading...