User Tools

Site Tools


Audio Conversions

June 2010
updated: July 2012

  • From FLAC to WAV

# using
# flac - Command-line FLAC encoder/decoder version 1.2.1
# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac -d <file.flac>

  • From FLAC to MP3

# using flac with pipelining to lame
# example for a directory with FLACs
# -dc = decode to stdout
# -b 320 = bitrate 320kpbs
# use quotes around $file to allow filename with spaces within
for file in *.flac; do flac -dc "$file" | lame -b 320 - /tmp/"$file".mp3; done

  • From WAV to FLAC

flac <file.wav>

  • From WAV/FLAC to OGG

Using vorbis-tools

oggenc -q 7 -o output.ogg input.wav|input.flac

# -q, --quality        Specify quality, between -1 (very low) and 10 (very
#                      high), instead of specifying a particular bitrate.
#                      This is the normal mode of operation.
#                      Fractional qualities (e.g. 2.75) are permitted
#                      The default quality level is 3.

  • From OGG to WAV

oggdec -o output.wav input.ogg

  • From WAV to MP3

Using lame

lame --preset extreme input.wav output.mp3
#    For VBR modes (generally highest quality):
#     "--preset medium" This preset should provide near transparency to most people on most music.
#     "--preset standard" This preset should generally be transparent to most people on most music and is already quite high in quality.
#     "--preset extreme" If you have extremely good hearing and similar equipment, this preset will generally provide slightly higher quality than the "standard" mode.
lame -b 128 input.wav output.mp3 # specify the bitrate

  • From MP3 to WAV

Using mpg123

mpg123 --wav output.wav input.mp3 // or just -w output.wav

linux/audio_conversions.txt · Last modified: 2013/03/16 17:40 (external edit)