Save Speex stream into a Wave file

Sep 17, 2010 at 1:15 PM

Anyone know how I can save my audio stream encode in speex in a wave file ?

Coordinator
Sep 17, 2010 at 1:28 PM

WAV is PCM encoded and not encoded with Speex so there is no way of doing that...

Sep 17, 2010 at 1:41 PM
balistof wrote:

WAV is PCM encoded and not encoded with Speex so there is no way of doing that...

But there is a PcmWaveWriter.cs class in the project which contains a boolean members "isPCM" and if it's false then when you write header it's not the same things. Are you sure you can't create a Wave file from a Speex stream ?

Coordinator
Sep 20, 2010 at 6:22 AM

Right, there is this PcmWaveWriter which can be used to wrote the Speex encoded data into a WAVE file. Using it is just straight forward. First, you construct an instance of the PcmWaveWriter using the longer contructor:

public PcmWaveWriter(int mode, int quality, int sampleRate, int channels, int nframes, bool vbr)

on this instance you call 

WritePacket(byte[] data, int offset, int len)

for every packet encoded with Speex.