Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting wav file to wav file (changing format)

Trying to find a workaround for my previous question, I'd like to convert a 16k 8bit mono wav which is written in byte[] (which has wav header) to a 8k 8bit mono stream/byte[].

Is there any .Net library with samples available for this kind of conversion?

Thank you.

like image 652
Kamyar Avatar asked Aug 24 '11 12:08

Kamyar


2 Answers

Thanks for the answers, I ended up using NAudio and with the following snippet, Voila! Everything works like a charm:

WaveFormat target = new WaveFormat(8000, 8 , 1);
WaveStream stream =new WaveFileReader("c:\\test.wav");
WaveFormatConversionStream str = new WaveFormatConversionStream(target, stream);
WaveFileWriter.CreateWaveFile("c:\\converted.wav", str);
like image 50
Kamyar Avatar answered Oct 14 '22 20:10

Kamyar


Alvas seems to support conversion as well as the usual features:

http://alvas.net/alvas.audio.aspx

like image 26
Russ Clarke Avatar answered Oct 14 '22 19:10

Russ Clarke