tags:

views:

1502

answers:

5

I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resources. Especially if I need many of them being done in parallel. Looking for a .NET library or code that will let me call this inside my process.

A: 

According to Wikipedia, G.729 includes several patents and is licensed by Sipra, so you probably won't have much luck finding an appropriate lobrary. Unless you're decoding a large number of very small files, the cost of spawning a new process shouldn't be that big compared to the cost of doing the decoding, so I'd say use the executable you have.

As far as resources go, yes, spawning processes requires a lot more resources compared to using threads. This shouldn't really matter, though, so long as you only spawn as many processes as you have cores in your machine. Spawning more processes just wastes resources and doesn't gain you any extra parallelism.

Adam Rosenfield
A: 

Wikipedia says: "G.729 includes patents from several companies and is licensed by Sipro (http://www.sipro.com/). In a number of countries, the use of G.729 may require a license fee and/or royalty fee."

But I guess you have already considered that in your application.

If you absolutely must be in-process, one solution (not saying it's the best) could be to use LibAVCodec, which is under LGPL.

Dan Cristoloveanu
+3  A: 

http://www.voiceage.com/openinit_g729.php

Phil
A: 

A free-to-use reference implementation at: http://www.readytechnology.co.uk/open/ipp-codecs-g729-g723.1/

Note the patent issues raised by others, the fact that the reference implementation only runs on Intel processors and that you need to pay Intel a fee in order to distribute code using their IPP library as part of a commercial product.

diciu
A: 

If you have an ACM codec on your system for G729 then you can use NAudio to convert it to PCM. Have a go using the NAudioDemo application included with NAudio which will show you what ACM codecs are available on your system, and decode a file using them.

Mark Heath