[linux-audio-dev] 8bit sound wav playing to a 16bit sound card...

Erik de Castro Lopo erikd-lad at mega-nerd.com
Thu Jun 12 17:32:01 UTC 2003


On Thu, 12 Jun 2003 11:18:53 -0400
Derrick <derrick at logicalsi.com> wrote:

> I'm new to OSS Programming, and I'm attempting to play some 8bit wav files.
> However OSS is telling me that my sound card will not play 8bit , only 16bit.
> If I force it. The sound changes pitch, and is very fast. ( obviously ).
> 
> Is there anyway to convert 8bit to 16bit on the fly? I've noticed that XMMS 
> also fails to play the 8bit wav file correctly. 

You can fix this by disabling XMMS's built in WAV reader and using XMMS_Sndfile
instead:

    http://www.zip.com.au/~erikd/XMMS/

which will also allow you to play a large number of other file types.

> I've even tryed to convert the file from 8bit to 16bit using SOX. But with the 
> same results. I would like to support 8bit file wavs in my program as MOST of 
> the wavs available are in 8bit format...

For reading sound files from within a program libsndfile:

    http://www.zip.com.au/~erikd/libsndfile/

which is required by XMMS_Sndfile anyway. It contains an example program which
uses OSS to play back any sound file it can read.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
I hack, therefore I am.



More information about the Linux-audio-dev mailing list