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

PCM to A-Law conversion

Nov 26, 2010 at 9:53 PM

I have to read stream from microphone (PCM 8Khz 16 bit) and pass it to destination pc over udp (rtp) in a-law format.I can get bytes stream in pcm and try to encode it in a-law using an algorithm found on web.The voice at destination pc is bad (noise).I think my problem is at encoding level.I found 'waveformatconversionstrem' feature but i'm not able to use it 'on the fly'....i mean that i need to get a-law converted bytes directly from pcm stream given at 'data available' callback function of waveInStrem.Found no code examples.Is it possible to do this ? If yes is there an example code about implementing this ?


Nov 29, 2010 at 9:04 PM

Sorry for going offtopic, but where did you find out how to implement the RTP protocol for UDP? I've been looking everywhere for a good source.

Nov 30, 2010 at 8:11 AM

you need to create a derived WaveStream that returns buffered bytes from the microphone in its Read method. This can then be used as an input to the WaveFormatConversionStream