Re: VOIP design question



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.
.



Relevant Pages

  • Re: pentode amplifiers
    ... audio from already chronically compressed CD's. ... cases you will find severe compression and clipping. ... That also accounts for why the hi-fi industry so ... You know that joke Patrick tells against Halcro, ...
    (rec.audio.tubes)
  • Re: On Spam / Flame Wars
    ... reduced audio quality), and what kind of headphones you use. ... of compression which provides the best balance between file size and audio ... cheap hard drives made in China are not recommended for secure long-term ... data security, so the rule remains backup, backup, backup. ...
    (alt.guitar.amps)
  • Anime Music FAQ for REC.ARTS.ANIME.* 3/3
    ... Anime Music FAQ ... Legality Issues with Anime Music ... Most of them do not use any compression. ... compressed audio data. ...
    (rec.arts.anime.misc)
  • Re: Anime Music FAQ for R.A.A.MUSIC 3/3
    ... Legality Issues with Anime Music ... Most of them do not use any compression. ... .ogg: Ogg Vorbis audio file. ... CCCD: Copy-Control CDs. ...
    (rec.arts.anime.music)
  • Re: DABSWTFM - lost his touch?
    ... And if audio quality is the defining reason why any new broadcast ... If you don't know why iPods have been so successful, no wonder DAB ... no need to use compression, but as it stands people do need to use ...
    (alt.radio.digital)