Convert WMA to MP3 in Ubuntu

Ubuntu (featured logo)

In order to convert WMA file into MP3 format in Ubuntu (or Debian) you should install the following requirements first:

1. mplayer (sudo aptitude install mplayer)
2. lame (sudo aptitude install lame)
3. win32 codecs (sudo aptitude install ubuntu-restricted-extras)

and then convert file.wma into file.mp3 using the following console command:

mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader file.wma;lame -m s -V 3 audiodump.wav;mv audiodump.wav.mp3 file.mp3;rm audiodump.wav

This also works for Fedora / Centos / Redhat family Linux distributions (requirements should be installed by yum package manager via third-party software repositories).

SHARE:
nv-author-image

Stefan Durand

My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

2 thoughts on “Convert WMA to MP3 in Ubuntu”

  1. Unfortunately this method didn’t work for me, seems like I need different headers to be able to convert the music. Here’s an example of the error message I got:

    MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing ScuttleButtin.wma.
    libavformat version 53.21.0 (external)
    Mismatching header version 53.19.0
    ASF file format detected.
    [asfheader] Audio stream found, -aid 1
    Clip info:
    title: Scuttle Buttin’
    author: Stevie Ray Vaughan
    Load subtitles in ./
    ==========================================================================
    Opening audio decoder: [dmo] Win32/DMO decoders
    Win32 LoadLibrary failed to load: /usr/lib/codecs/wma9dmod.dll
    IMediaObject ERROR: 0x83e21f6 could not open DMO DLL (0x0 : 0)
    ERROR: Could not open required DirectShow codec wma9dmod.dll.
    ADecoder preinit failed 🙁
    ADecoder init failed 🙁
    Opening audio decoder: [dmo] Win32/DMO decoders
    Win32 LoadLibrary failed to load: /usr/lib/codecs/wmadmod.dll
    IMediaObject ERROR: 0x83e21f6 could not open DMO DLL (0x0 : 0)
    ERROR: Could not open required DirectShow codec wmadmod.dll.
    ADecoder preinit failed 🙁
    ADecoder init failed 🙁
    Cannot find codec for audio format 0x163.
    Audio: no sound
    Video: no video

    Exiting… (End of file)
    Could not find “audiodump.wav”.
    mv: cannot stat `audiodump.wav.mp3′: No such file or directory
    rm: cannot remove `audiodump.wav’: No such file or directory

    Any ideas??
    Regards,
    Tomas

Leave a Reply

Your email address will not be published. Required fields are marked *