Convert WAV to WMA using .NET.

What is the best solution to convert WAV files to WMA (and vice versa) in C #? I actually implemented this already using the Windows Media Encoder SDK, but to distribute the Windows Media Encoder with my application is at least cumbersome. The Windows Media SDK format has large API sections marked as deprecated. It looks like there might be some DirectX Media Objects (DMOs) that I could use from the Windows SDK, but there would be a lot of talk to write.

I am wondering if a good managed shell is possible for an unmanaged library that can perform conversions. This will require a license, which allows you to distribute it as part of a commercial application with closed source code.

+6
audio wma
source share
5 answers

I have not tried this personally (so Iโ€™m not sure if this is the โ€œbestโ€ solution), but http://www.codeproject.com/KB/audio-video/WmaCompressor.aspx looks like this should meet your requirements ...

+1
source share

You can look at the BASS library . It has add-ons such as BASSWMA and BASSEnc for encoding / decoding. All its APIs are accessible from .NET using BASS.Net .

Both BASS and BASS.Net can be licensed for commercial use with reasonable payment (100 euros each).

+1
source share

If you are comfortable writing a bit of C ++ / CLI, you don't need a lot of code to create a wrapper around DirectShow for this. This can then be called directly from the C # assembly, without the need to interact with interop. Doing it with DirectShow is a lot easier than using WMF directly, because you donโ€™t need to do any file analysis or I / O - all this is done for you. For reference, I have code in a commercial application that can encode / decode WMA to / from WAV files on less than 100 C ++ lines, all of which are completed in a friendly .Net class. The wise use of smart pointers helps if you go down this route ...

+1
source share

First of all, look at this:

http://windowsmedianet.sourceforge.net/

Then search for IWMWritter and various ways to initialize it. You will supply raw PCM data and it will write a wma file.

Please mark my answer for more information about this.

+1
source share

You can see www.mitov.com . There are some libraries that can help. I suppose you will need to buy a copy for shipment to a commercial product, but I think this is a reasonable price.

0
source share

All Articles