views:

143

answers:

5

Which audio codec should I choose for my C# software development project where the raw audio to be transcoded/transported/used is based on the following:

  1. For encoding Speech only
  2. Audio can be stereo or mono
  3. Able to support live streaming
  4. Good tradeoff between file size and quality
  5. To be transported over TCP/IP in its encoded form
  6. Can be played back by a readily available free player without further processing

Note that whether there is a readily available free codec library for performing transcoding does not need to be taken into consideration.

A: 

You could use LAME for MP3 encoding with the 'voice' presets. I would recommend testing different ones though, because of issues like this.

MP3 is what KPFA.org (and now KQED, I think) both use for live streaming. Works great. Don't know what server sw is used though.

Andrew Backer
A: 

Given your choice of Language, if it is safe to assume that you are using Windows, I would actually recommend WMA, the Windows Format. The libraries are all going to be built in, and, all things considered, is a very solid codec. Supports all your requirements and more.

However, if you're going to be pushing to a flash endpoint, use .fla, Flash Audio. Flash definitely optimizes for consuming this and, while it's not quite as easy to use with C#, you'll definitely appreciate the ease of consumption on the other end.

aronchick
+1  A: 

Speex is free open-source codec, designed for encoding speech in realtime solutions that need low latency. General-purpose compression schemes such as WMA or MP3 are likely to cause more delay and they also may not be able to operate well at very low bitrates. http://www.speex.org/

Tronic
A: 

If you're only targeting Windows, GSM codec is probably a good choice for low bandwidth applications. It is generally considered to be lower quality than Speex but uses a fair amount less bandwidth as well.

Windows Media Player can playback GSM and the encoder is part of Media Foundation in Vista and above (and presumably some Win32 API in XP and below?)

Coxy
A: 

The ADPCM family of codecs were designed originally for encoding telephone conversatons, so they are optimized for speech, they are fairly cheap to encode and decode and are fairly well supported. Windows had native support last time I checked, but they are a bit old and crusty and you almost certainly get better quality at lower bitrates with a more modern encoder. (at the cost of more CPU horsepower needed to run). I'm not sure what short of transport you could use with this. Telephone equipment tended to use ADPCM with their own built in transport.

Truespeech is a more modern codec. Supported on Windows last time I checked and compatible with .wmv as a transport.

John Knoeller