This project has moved and is read-only. For the latest updates, please go here.

WaveFormatConversionStream 16 bit to 8 bit conversion problem...

Mar 25, 2014 at 12:49 PM

I am trying to send the bytes of the mixer(WaveMixer32) output from the ethernet port and
i have to change format while sending of the mixer output:

I have written a code like this:

Wave32to16Stream w3216 = new Wave32To16Stream(mixer)
WaveFormatConversionStream wfc = new WaveFormatConversionStream(wFormatOutput,w3216);
.... sending data at the end!

It is working succesfully if my wFormatOutput is 8kHz,16 bit, stereo

But if my my wFormatOutput is 8Khz, 8 bit, stereo, the problem begins.

If I mix more than 3 inputs with my mixer, all data read is becoming 255, I think it is a conversion problem.

My question is :
Is WaveFormatConversionStream capable of converting samples from 16 bit to 8 bit ?

And if not, what will I do to convert a 16 bit stream to 8 bit stream?
Apr 7, 2014 at 8:19 AM
I wouldn't recommend using 8 bit audio - it has very poor dynamic range. There are much better ways to compress audio. If you must use 8 bit samples, then consider using G.711 (mu law or a law) compression.