SoX est un logiciel de traitement de son en ligne de commande. Il consiste en une suite d'outils permettant par exemple de changer le format, de filtrer, de rajouter des fondus, d'analyser un fichier, etc.
Il vous suffit, pour cela, d'installer le paquet sox.
Afin de profiter pleinement des possibilités de SoX (comme la manipulation du mP3 ou de l'ogg
), il est recommandé d'installer aussi le paquet libsox-fmt-all.
Play lit les fichiers musicaux. Par exemple :
play *.mp3
play fichier.mp3 vol 2
Sox permet la manipulation des fichiers. Par exemple :
sox fichier.mp3 fichier.ogg
sox fichier1.ogg fichier2.ogg fichier_final.ogg
sox entree.wav sortie.wav vol 10db
sox entree.ogg sortie.ogg vol -6dB bass +6
sox entree.ogg -n stat
sox entree.ogg -n stats
#!/bin/bash
###
# stereo 2 surround
###
inFile="$1";
outFile="$2";
debug="$3";
# todo ...
#if [ ! -z sox ]; then
#echo "sox"
# run=0;
#fi
#if [ ! -x multimux ]; then
#echo "multimux"
# run=0;
#fi
#if [ ! -x soxi ]; then
#echo "soxi"
# run=0;
#fi
#if [ ! -x normalize ]; then
#echo "normalize"
# run=0;
#fi
# default parameter
soxParm="";
normParm="-q";
# debug parameter
if [ $debug -eq 1 ]; then
soxParm="-V -S";
normParm="-v";
fi
if [ $run -eq 0 ]; then
echo "Error: Requirenment missing: normalize multimux, sox or soxi";
else
echo " Preparing Source";
normalize $normParm $inFile;
rate=$(soxi $inFile | grep "Sample Rate" | awk '{ print $4; }');
# if rate is 44100, we'll most likely have stuff from an audio-cd,
# which we want to deemph at least i assume so
if [ $rate -eq 44100 ]; then
echo " + Source is 44.1kHz, De-Emphasing & Resampling...";
sox $soxParm -c 2 $inFile source.wav deemph rate -v -a 48000
else
sox $soxParm -c 2 $inFile source.wav rate -v -a 48000
fi
# create combined channel
sox $soxParm -c 2 source.wav -c 1 combined.wav mixer 0.5,0.5
normalize $normParm combined.wav
# create pre- left and right channels
sox $soxParm -c 2 source.wav -c 1 sleft.wav mixer -l
sox $soxParm -c 2 source.wav -c 1 sright.wav mixer -r
sox $soxParm -M -c 1 -v -1 sright.wav -c 1 combined.wav -c 1 right.wav
normalize $normParm right.wav
sox $soxParm -M -c 1 -v -1 sleft.wav -c 1 combined.wav -c 1 left.wav
normalize $normParm left.wav
# frequency games
sox $soxParm -c 1 left.wav -c 1 ls.wav sinc 100-6000 reverb
sox $soxParm -c 1 right.wav -c 1 rs.wav sinc 100-6000 reverb
sox $soxParm -c 1 combined.wav -c 1 c.wav sinc 80-12000
sox $soxParm -c 1 combined.wav -c 1 lfe.wav sinc 20-200
sox $soxParm -c 1 left.wav -c 1 lf.wav sinc 80-20000
sox $soxParm -c 1 right.wav -c 1 rf.wav sinc 80-20000
# normalize it in batch-mode
normalize $normParm -b ls.wav rs.wav c.wav lfe.wav lf.wav rf.wav
# let's mux it
multimux -d 0,0,15,15,0,0 lf.wav rf.wav ls.wav rs.wav c.wav lfe.wav > $outFile
# cleanup
rm left.wav right.wav combined.wav source.wav sleft.wav sright.wav
fi
Rec permet d'enregistrer des sons.
Pour enregistrer l'entrée micro par défaut en un fichier audio au format ogg :
rec -d test.ogg
Le fichier test.ogg est alors créé dans le répertoire courant.
rec -d ~/Desktop/ma_voix.wav
Le fichier ma_voix.wav est créé sur le bureau.
Plus d'informations sur rec et ses nombreuses options avec son manuel :
rec --help
Un script pour faciliter l'utilisation de rec est disponible dans ce sujet du forum.