Re: VOIP design question
- From: "Chris P. [MVP]" <msdn@xxxxxxxxxxxx>
- Date: Wed, 5 Oct 2005 08:33:18 -0400
On 4 Oct 2005 16:48:26 -0700, eselk@xxxxxxxxxxxx wrote:
> I currently just use PCM format in my VOIP project. I'd like to see
> what advantages I can get by using audio compression codecs. Should I
> change my calls to waveOutOpen and waveInOpen and just specify a codec
> to those calls? Or should I leave them the same and them somehow apply
> the codecs to the data before sending to winsock, and then convert them
> back before sending to waveOutWrite?
I suggest using the acm functions. See "Audio Compression Manager", and
acmStreamOpen() in the Platform SDK documentation. You pass in a PCM
buffer, it will pass out a compressed buffer. Choose your algorithm
carefully if you are expecting some packet loss.
> I didn't find any obvious functions to allow me to compress/uncompress
> wav data, so I assume I need to change waveOutOpen and waveInOpen.
That's one way but it will only work if the audio device is WAVE_MAPPER.
> If I change waveInOpen, does this just effect the "bytes recorded"
> value in the returned data? In other words, if I pass in a 300 byte
> buffer to waveInAddBuffer, will it just return a shorter (compressed)
> buffer, but the buffer will still contain the same length (in time) of
> data?
>
> With tiny packets, around 300 to 600 bytes (50 to 100ms), can the
> compression really be very good (more than a few %)?
Theoretically you can reduce the datasize and improve the audio quality.
The audio quality improvement would come from increasing the samplerate
over what you were using for PCM. 16kHz is the modern norm for
high-quality VOIP applications. Typical compression ratios for compressed
audio is from 4:1 to 16:1 (vs 16kHz PCM). The higher the compression,
lower the quality typically. For VOIP too much compression can be
detrimental as your packet size will be too small.
.
- Follow-Ups:
- Re: VOIP design question
- From: eselk
- Re: VOIP design question
- References:
- VOIP design question
- From: eselk
- VOIP design question
- Prev by Date: Re: AC97 special stereo mode
- Next by Date: DShow How 2 write output to full-screen WIN32 pre-created window
- Previous by thread: VOIP design question
- Next by thread: Re: VOIP design question
- Index(es):
Relevant Pages
|