Skip to content

Latest commit

 

History

History

audio

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Audio

  1. Codecs

Directories

On most systems, sound will be kept under:

/usr/share/sounds

They are put under share because that is where arch independent files used by applications should be put.

You can also create ~/share/sounds for you favorite sounds.

A good technique is to define an alias as:

alias playa='paplay ~/share/sounds/alert.ogg' # play Alert

so you can play it after commands end:

sleep 2 && playa

If you want to have some real good fun try:

find /usr/share/sounds -type f -iname '*.ogg' | sort | xargs -I'{}' play '{}'

Players

paplay

Pulse Audio play.

Comes by default on Ubuntu 12.04.

Play file once and exit:

play a.wav

Terminates when over. Good option to play an alarm signal after a very long command:

sleep 5 && play ~/share/sounds/alert.*

aplay

ALSA player.

Comes with Ubuntu 12.04, but did not work very well.

play

SoX package. Similar to paplay.

Play .raw file:

play -b 16 -c 1 --endian big -e unsigned -r 44100 in.raw

cplay

ncurses CLI.

Has a file browser.

cplay

Manipulation

lame

Encode, decode and modify MP3.

Increases volume 5x:

lame --scale 5 a.mp3

WAV to MP3:

lame a.wav a.mp3

id3tool

Get id3 tags info (for MP3 for example):

TITLE="`id3tool "$1" | grep '^Song Title:' | awk '{ for (i=3;i<=NF;i++) { printf $i; printf " " } }'`"
ARTIST="`id3tool "$1" | grep '^Artist:' | awk '{ for (i=2;i<=NF;i++) { printf $i; printf " " } }'`"
ALBUM="`id3tool "$1" | grep '^Album:' | awk '{ for (i=2;i<=NF;i++) { printf $i; printf " " } }'`"
YEAR="`id3tool "$1" | grep '^Year:' | awk '{ for (i=2;i<=NF;i++) { printf $i; printf " " } }'`"
TRACKNUM="`id3tool "$1" | grep '^Year:' | awk '{ print $2 }'`"

install -D "$1" /music/mp3/"$ARTIST-$ALBUM-$YEAR"/"$TRACKNUM-$ARTIST-$TITLE".mp3

Cut up FLAC CUE into multiple files

flacon

GUI.

shntool

Single APE and CUE in dir, FLAC output, formatted as number - author - track

shntool split -f *.cue -o flac -t '%n - %p - %t' *.ape

You need the mac CLI tool to do this, and the easiest way to get it is with:

sudo add-apt-repository -y ppa:flacon
sudo apt-get update
sudo apt-get install -y flacon

See also:

SoX

Set of utilities record, play and modify files via CLI.

Interactive front end for libSoX.

Must install available formats separately.

Record from microphone into a.wav file:

rec a.wav

ctrl+c to stop recording.

ALSA

Advanced Linux Sound API.

Replaced OSS in 2008 when OSS when went proprietary. OSS came back to open source, but it lost much momentum.

The kernel sound subsystem is called ALSA.

There are a few tools that interact with it.

alsamixer

ncurses interface to view/control sound parameters

alsamixer

Commands:

  • left/right : change active parameter
  • up/down : change active parameter value

amixer

CLI for sound control.

View available controls:

amixer scontrols

Set master volume to 50%:

amixer sset 'Master' 50%

Unmute sound:

amixer -D pulse set Master 1+ unmute

aplay

Command line tool that takes numeric input from stdin and generate sound.

pulseaudio

Vs alsa:

http://askubuntu.com/questions/426983/how-can-i-tell-if-im-using-alsa-or-pulse-audio-by-default-switching-to-i3-wm

pacmd

Command line control to PulseAudio.

rip

abcde

CLI

Rip from DVD:

abcde

Automatically finds right configurations on most systems.

Creates dir in cur dir and saves rip out as .ogg (Vorbis) in it.

Synthesis

pico2wave

Text to speech.

sudo aptitude install libttspico-utils

Say "hello world":

pico2wave -w a.wav "hello world"

"hello world" is not a filename! It is the actual input! There seems to be no way to get input from files or stdin.

Virtual Midi Piano Keyboard

vmpk