Convert mp3 file to wav? using the command line?

85,215

Using ffmpeg - installed by default

ffmpeg -i input.mp3 output.wav 

Alternative - mpg123

sudo apt-get install mpg123

Then to convert mp3 to wav (using -w option)

mpg123 -w output.wav input.mp3
Share:
85,215

Related videos on Youtube

TellMeWhy
Author by

TellMeWhy

I Wonder

Updated on September 18, 2022

Comments

  • TellMeWhy
    TellMeWhy over 1 year

    I have an Mp3 file i need to convert to .wav to be able to import it into a voice changer program.

    How do I do this using the command line?

  • kRazzy R
    kRazzy R about 6 years
    Hi ,if possible could you expand it to run on all files in a folder?
  • datakid
    datakid about 6 years
    @kRazzyR: for f in ls; do ffmpeg -i $f $(basename $f).wav; done
  • tro
    tro about 5 years
    @datakid Looks like syntax highlighter ate several symbols in your code. I've added your working solution into answer as UPD.
  • scai
    scai over 4 years
    @datakid You should not parse ls output. Instead use for f in *.mp3; do ffmpeg -i "$f" "$(basename $f).wav"; done. This also includes proper quoting and limits calling ffmpeg for mp3 files only.
  • F. Vosnim
    F. Vosnim almost 4 years
    How to get 32 bit floating point wav with mpg123?
  • Ethan
    Ethan about 2 years
    You can get 32 bit float wav output by adding the flag: "--encoding f32" or "-e f32"