Dec 16, 2009 at 2:40 PM
Edited Jan 4, 2010 at 11:29 AM
I am having trouble using the WaveFormatConversionStream. I am trying to convert one WAV to another WAV with a higher sample rate, and I am hearing a significant loss of quality.
The original is:
Bit Rate: 245kbps
Sample Size: 16 bit
Sample Rate 16 kHz
Audio Format PCM
The code I am using is below, I have a WPF app that has buttons corresponding to the methods here. Just to be clear, I hear the output both times, just that the original sounds MUCH better than the converted one. The converted one almost sounds
like the microphone was clipping, but that is not the case since the original is fine.
private void btOriginal_Click(object sender, RoutedEventArgs e)
private void InitWave()
originalStream = new WaveFileReader(@"C:\temp\waves\original.wav");
private void btConverted_Click(object sender, RoutedEventArgs e)
WaveFormat format = new WaveFormat(44100,16,originalStream.WaveFormat.Channels);
WaveStream w1 = new WaveFormatConversionStream(format, originalStream);
private void PlayWaveStream(WaveStream stream)
using (WaveOut waveOut = new WaveOut(WaveCallbackInfo.FunctionCallback()))
while (waveOut.PlaybackState == PlaybackState.Playing)
Any ideas as to what I am missing or what I can try to improve the quality of the conversion would be appreciated. I have tried to use a BlockAlignReductionStream as well but no difference.