Geody Labs


# Main Index: Debian Linux Magic Spells Cheat Sheet (one liners, how to, tips and tricks)

# Audio

Play a sound:
printf '\7' # Ring the Bell

Play MP3 files:

apt-get install mpg321

mpg321 FILE.mp3


Extract audio tracks from a CD:

apt-get install cdda2wav

cdda2wav -B # extract tracks as WAVs from the default CD player
cdda2wav -D  /dev/cdrom -B # extract tracks as WAVs from the specified CD player


Create an Audio CD writing WAVs as audio tracks:

apt-get install cdrecord

cdrecord dev=0,0,0 speed=4 -eject -pad -audio -raw -swab *.wav # write all WAVs from the current directory


Create an Audio CD writing MP3s/OGGs/flacs as audio tracks:

apt-get install mp3burn

mp3burn *.mp3 # create an audio CD from all MP3s in the current directory
mp3burn -p "PLAYLIST.m3u" # create an audio CD fetching files listed in a M3U playlist


Edit ID3v1 tags:

apt-get install id3ed

id3ed -i FILE.mp3 # return id3v1 tag
id3ed -r FILE.mp3 # remove id3v1 tag
id3ed -s SONGNAME -n ARTIST -a ALBUM -y YEAR -c COMMENT -k TRACKNUM -g GENRE_NUMBER FILE.mp3 # set id3v1 for FILE.mp3
id3ed -s SONGNAME -n ARTIST -a ALBUM -y YEAR -c COMMENT -k TRACKNUM -g GENRE_NUMBER *.mp3 # set id3v1 for all mp3 files in the current directory


Edit ID3v1 and ID3v2 tags:

apt-get install id3v2

id3v2 -l FILE.mp3 # return id3 tags
id3v2 -1 -l FILE.mp3 # return id3v1 tag
id3v2 -2 -l FILE.mp3 # return id3v2 tag
id3v2 --delete-v1 FILE.mp3 # remove id3v1 tag
id3v2 --delete-v2 FILE.mp3 # remove id3v2 tag
id3v2 --delete-all FILE.mp3 # remove all tags (id3 v1 and v2)
id3v2 -C FILE.mp3 # convert id3v1 to id3v2 tag
id3v2 -a "ARTIST" -A "ALBUM" -t "SONG" -c "COMMENT" -g GENRE_NUMBER -y YEAR -T TRACK FILE.mp3 # set id3 for FILE.mp3
id3v2 -a "ARTIST" -A "ALBUM" -t "SONG" -c "COMMENT" -g GENRE_NUMBER -y YEAR -T TRACK *.mp3 # set id3 for all mp3 files in the current directory
id3v2 -1 -a "ARTIST" -A "ALBUM" -t "SONG" -c "COMMENT" -g GENRE_NUMBER -y YEAR -T TRACK FILE.mp3 # set id3v1 for FILE.mp3
id3v2 -2 -a "ARTIST" -A "ALBUM" -t "SONG" -c "COMMENT" -g GENRE_NUMBER -y YEAR -T TRACK FILE.mp3 # set id3v2 for FILE.mp3


Check MP3 files:

apt-get install mp3check

mp3check FILE.mp3 # check crc and headers of mp3 files for consistency
mp3check -a FILE.mp3 # check mp3 file for differences from layer 3, 44.1kHz, 128kB, joint stereo, no emphasis, has crc


Lossless MP3 normalization (peak and loudness normalization):

apt-get install mp3gain

mp3gain FILE1.mp3 FILE2.mp3 FILE3.mp3 # normalize specified mp3 files (warning: overwrites source files)
mp3gain -r FILE1.mp3 FILE2.mp3 FILE3.mp3 # normalize specified mp3 files all to equal loudness (warning: overwrites source files)
mp3gain -a FILE1.mp3 FILE2.mp3 FILE3.mp3 # normalize specified mp3 files to the average loudness, intended for all audio files from a same album (warning: overwrites source files)
mp3gain -u FILE.mp3 # undo changes made by mp3gain (based on info stored on tag)


Convert WAV to MP3:

apt-get install lame

lame FILE.wav FILE.mp3


Convert MP3 to WAV:

apt-get install mpg321

mpg321 -w FILE.wav FILE.mp3 # convert FILE.mp3 to FILE.wav


Convert MP3 to OGG:

apt-get install mp32ogg

mp32ogg FILE.mp3 # convert FILE.mp3 to FILE.ogg
mp32ogg --rename=DEST.ogg SOURCE.mp3 # convert SOURCE.mp3 to DEST.ogg
mp32ogg --rename=%a_%l_%t.ogg *.mp3 # convert all mp3 files in the current directory renaming generated OGG files as ARTIST_ALBUM_TRACKTITLE.ogg (make sure that id3 tag contains all such information, otherwise files will be called as SOURCEFILE.ogg)


Convert an audio format into another audio format

apt-get install sox

sox SOURCE_FILE.SOURCE_EXT DEST_FILE.DEST_EXT # convert SOURCE_FILE.SOURCE_EXT to DEST_FILE.DEST_EXT. File format conversion is based on standard extensions
sox FILE.ogg FILE.mp3 # convert FILE.ogg into FILE.mp3 (note that MP3 support is optional. check sox --help for supported formats)

Reverse audio:
sox -V SOURCE_FILE.wav DEST_FILE.wav reverse




Please DONATE to support the development of Free and Open Source Software (PayPal, Credit Card, Bitcoin, Ether)

Page issued on 25-Sep-2022 04:28 GMT
Copyright (c) 2022 Geody - Legal notices: copyright, privacy policy, disclaimer