<p>What is the best solution for converting WAV files to WMA (and vice versa) in C#? I have actually implemented this once already using the Windows Media Encoder SDK, but having to distribute Windows Media Encoder with my application is cumbersome to say the least. The Windows Media Format SDK has large sections of the API marked as deprecated. It looks like there might be some DirectX Media Objects (DMOs) I could use from the Windows SDK, but there would be an awful lot of interop to write.</p>

<p>I am wondering if there perhaps is a good managed wrapper for an unmanaged library that can perform the conversions. It would need a license that allows it to be distributed as part of a closed source commercial application.</p>

[{'answer_id': 64442, 'author': 'mdb', 'author_id': 8562, 'author_profile': 'https://Stackoverflow.com/users/8562', 'pm_score': 2, 'selected': True, 'text': '<p>I haven\'t tried it personally (so not sure if it\'s the \'best\' solution), but <a href="http://www.codeproject.com/KB/audio-video/WmaCompressor.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/audio-video/WmaCompressor.aspx</a> looks like it should meet your requirements...</p>\n'}, {'answer_id': 91524, 'author': 'Magnus Johansson', 'author_id': 3584, 'author_profile': 'https://Stackoverflow.com/users/3584', 'pm_score': 1, 'selected': False, 'text': '<p>You can take a look at the <a href="http://www.un4seen.com/" rel="nofollow noreferrer">BASS library</a>.\nIt has add-ons, such as BASSWMA and BASSEnc for doing encoding/decoding.\nAll its API\'s are accessible from .NET using the <a href="http://www.un4seen.com/bass.html#apis" rel="nofollow noreferrer">BASS.Net</a> wrapper.</p>\n\n<p>Both BASS and BASS.Net could be licensed for commercial use, with a reasonable fee (€100 each).</p>\n'}, {'answer_id': 212671, 'author': 'Stu Mackellar', 'author_id': 28591, 'author_profile': 'https://Stackoverflow.com/users/28591', 'pm_score': 1, 'selected': False, 'text': "<p>If you're comfortable writing a bit of C++/CLI then you don't need much code to create a wrapper around DirectShow to do this. This can then be called directly from a C# assembly with no need to mess about with interop. Doing it with DirectShow is much easier than using WMF directly because you don't have to do any file parsing or I/O - it's all done for you. For reference, I have code in a commercial app that can encode/decode WMA to/from WAV files in less than 100 lines of C++, all wrapped up in a friendly .Net class. Judicious use of smart pointers helps if you go down this route...</p>\n"}, {'answer_id': 219160, 'author': 'GuyWithDogs', 'author_id': 9520, 'author_profile': 'https://Stackoverflow.com/users/9520', 'pm_score': 0, 'selected': False, 'text': '<p>You might look at <a href="http://www.mitov.com" rel="nofollow noreferrer">www.mitov.com</a>. There are some libraries there that may help. You\'ll need to buy a copy to ship in a commercial product, I believe, but I think it\'s a reasonable price.</p>\n'}, {'answer_id': 3625803, 'author': 'Daniel Mošmondor', 'author_id': 166251, 'author_profile': 'https://Stackoverflow.com/users/166251', 'pm_score': 1, 'selected': False, 'text': '<p>First of all, look at this:</p>\n\n<p><a href="http://windowsmedianet.sourceforge.net/" rel="nofollow noreferrer">http://windowsmedianet.sourceforge.net/</a></p>\n\n<p>Then, search for IWMWritter - and various ways of initializing it.  You will supply raw PCM data, and it will write out wma file.</p>\n\n<p>Tag my answer please for more info on this.</p>\n'}]
['https://Stackoverflow.com/questions/64303', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7532/']