Link to home
Start Free TrialLog in
Avatar of azyet24
azyet24Flag for United States of America

asked on

VB.NET Convert WMA to MP3 or WAV

Is it possible to convert a .wma file to either .wav or .mp3 using VB.NET?  
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of azyet24

ASKER

Excuse my ignorance, but I don't see how I'd be able to use this with vb.net.  Can you show me how I would use this to conver .wma to .mp3?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of azyet24

ASKER

These all talk about video conversions.  I need audio from wma to mp3.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VaughnWilliams
VaughnWilliams

Another sourceforge project you might want to look at is http://sourceforge.net/projects/winlame/
Avatar of azyet24

ASKER

I downloaded the sourcecode from http://mediaconverter.codeplex.com/ and tried to convert a wma to mp3 and the file is created but has zero bite and doesn't play.  I know it says it can work with wma but I'm not sure that it will.
Avatar of azyet24

ASKER

The solution has to be accessible from code (command line) and not GUI.  Quick glance looks like winLAME is GUI.
Avatar of azyet24

ASKER

Update. I tested http://mediaconverter.codeplex.com/ ffmpeg with other wma files and was able to convert them fine.  For some reason the Exchange UM wma files are not converting correctly.  Maybe its the bit rate or something.
Avatar of azyet24

ASKER

When I try to run ffmpeg manually, here's the message it gives me:

C:\Users\Desktop\SourceCode\Media Converter.NET\Resources>ffmpeg -i vm.wma vm.mp3
FFmpeg version SVN-r7760, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-memalign-hack --enable-gpl --cpu=i686 --enable-swscal
er --enable-pthreads --enable-avisynth --enable-mp3lame --enable-xvid --enable-x
264 --enable-libnut --enable-libogg --enable-vorbis --enable-libtheora --enable-
faad --enable-faac --enable-libgsm --enable-dts --enable-a52 --enable-amr_nb --e
nable-amr_wb
  libavutil version: 49.2.0
  libavcodec version: 51.29.0
  libavformat version: 51.8.0
  built on Jan 29 2007 19:58:47, gcc: 3.4.6
Input #0, asf, from 'vm.wma':
  Duration: 00:00:22.4, start: 3.551000, bitrate: 11 kb/s
  Stream #0.0: Audio: 0x000a, 8000 Hz, mono, 8 kb/s
Output #0, mp3, to 'vm.mp3':
  Stream #0.0: Audio: mp3, 8000 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Unsupported codec (id=0) for input stream #0.0
On the commercial side you can look at the the bass audio libraries (includes vb code samples) http://www.un4seen.com/ 
Note: If your need is non commercial then this is free...else there is $$ to be paid.

If this looks interesting, then aside from the bass examples you can also look at the following  codeproject url: http://www.codeproject.com/KB/audio-video/nbass.aspx


Another area also to explore if you need to go the other way (to windows formats) is:
Microsoft Windows Media Audio Compressor:
http://www.codeproject.com/KB/audio-video/WmaCompressor.aspx
http://msdn.microsoft.com/en-us/library/dd757738(VS.85).aspx
With regards to the exchange files, it could be something unique about the codec that they are using; suggest you research that area; also give the Bass libraries a try, who know maybe there's more success down that road.

PS the idea behind providing winLame was to look at the code for inspiration.
If you look at the ffmpeg output it confirms it's a codec issue: Unsupported codec (id=0) for input stream #0.0

Maybe google can be of help; i.e. can the exchange codec be downloaded?
Gotta run; last thing you could look into is whether you can change the codec used on the Exchange side i.e. to one which is supported by ffmpeg.  I saw via google that there are some known issues with for example: listening to exchange wma files on Blackberry phones which could be rectified by change the encoding being used.

Cheers...
Avatar of azyet24

ASKER

Split points b/c each provided valued input.  Unfortunatly this did not work for me b/c I need to convert Exchange UM .wma files and ffmpeg does not work with UM, but this would be a good solution for others.