Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Upconvert WAV sample rate

$
0
0

I have a WAV file at 8000 samples/sec and 8 bits per sample.  It's stored as a C# byte array in memory.

It needs to be converted to a 16000 samples/sec, 16 bits/sample WAV.  The converted WAV can be either a byte array or a MemoryStream.

I've tried using WaveFileWriter.WriteData with the new format (the output is high pitched and garbled), WaveFileWriter.WriteSamples (confusing; apparently it needs floats but I have bytes), WaveFormatConversionStream (this doesn't seem to produce a valid WAV - there's no "RIFF" in the header).

If this possible?  Is there an easy to follow sample somewhere?

Thanks!


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>