views:

568

answers:

3

What is the best way to convert various audio formats to PCM?

For example: mp3, evrc, ogg vox.

Is there a library out there that will allow me to implement this relatively easily?

EDIT:

I guess my initial question wasn't really what I needed. Most of the libs I have found are file converters. What I need is a block converter, where I pass in a 1Kb block of vox data and it returns its converted PCM block. Of course I’ll have to tell the converter what type of data it is and various pieces of codec information.

The solution I am going for is to save and VOIP formats into a common wav format and to play that conformed file in real time. I thought there should be an easy way to do this because all audio is eventually turned into PCM before it is outputted anyways.

A: 

Don't know any lib that does it all but we do mp3->wav using madxlib.

It's free but I suggest paying the $10 for the sdk as it comes with documentation and examples.

Nifle
+3  A: 

You can use NAudio to pass blocks of compressed audio into any ACM codecs you have installed on your machine. You do need to know how to create the appropriate WAVEFORMAT structure to describe the compressed audio type correctly though.

Mark Heath
A: 

There is a c# tutorial on youtube that might be helpful to you. It shows how to use a specific audio library called alvas.audio that really does some neat things with audio. I found the video to be very educational. The audio library is completely written in c#. Watch the video for more details: http://www.youtube.com/watch?v=2DIQECXFPeU

nelson