Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
sox [Le 17/10/2009, 19:08] – 213.95.41.13 | sox [Le 01/02/2021, 01:38] (Version actuelle) – 193.250.138.71 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | {{tag> | ||
+ | ---- | ||
+ | ======SoX ===== | ||
+ | SoX est un logiciel de traitement de son en **ligne de commande**. Il consiste en une suite d' | ||
+ | |||
+ | ===== Pré-requis ===== | ||
+ | * Avoir activé l' | ||
+ | |||
+ | ===== Installation ===== | ||
+ | Il vous suffit, pour cela, d' | ||
+ | |||
+ | Afin de profiter pleinement des possibilités de SoX (comme la manipulation du mP3 ou de l'ogg ;-)), il est recommandé d' | ||
+ | |||
+ | ===== Les différents outils ==== | ||
+ | * [[#play]] : pour lire les fichiers musicaux | ||
+ | * [[# | ||
+ | * [[#rec]]: pour enregistrer des sons | ||
+ | |||
+ | ==== play ==== | ||
+ | **Play** lit les fichiers musicaux. Par exemple : | ||
+ | * pour lire tous les fichiers mp3 d'un répertoire à la suite :< | ||
+ | * pour lire un fichier "2 fois plus fort" :< | ||
+ | |||
+ | ==== sox ==== | ||
+ | **Sox** permet la manipulation des fichiers. Par exemple : | ||
+ | * pour créer un ogg à partir d'un mp3 :< | ||
+ | * pour concaténer plusieurs fichiers en un seul :< | ||
+ | * pour augmenter de 10db < | ||
+ | * pour augmenter les basses tout en évitant la saturation :< | ||
+ | * pour imprimer une analyse du fichier son (amplitude, volume...):< | ||
+ | * pour imprimer une analyse du fichier son (dB, channel..) < | ||
+ | * pour convertir un fichier stéreo en " | ||
+ | #!/bin/bash | ||
+ | |||
+ | ### | ||
+ | # stereo 2 surround | ||
+ | ### | ||
+ | |||
+ | inFile=" | ||
+ | outFile=" | ||
+ | debug=" | ||
+ | |||
+ | # todo ... | ||
+ | #if [ ! -z sox ]; then | ||
+ | #echo " | ||
+ | # run=0; | ||
+ | #fi | ||
+ | |||
+ | #if [ ! -x multimux ]; then | ||
+ | #echo " | ||
+ | # run=0; | ||
+ | #fi | ||
+ | |||
+ | #if [ ! -x soxi ]; then | ||
+ | #echo " | ||
+ | # run=0; | ||
+ | #fi | ||
+ | |||
+ | #if [ ! -x normalize ]; then | ||
+ | #echo " | ||
+ | # run=0; | ||
+ | #fi | ||
+ | |||
+ | # default parameter | ||
+ | soxParm=""; | ||
+ | normParm=" | ||
+ | |||
+ | # debug parameter | ||
+ | if [ $debug -eq 1 ]; then | ||
+ | soxParm=" | ||
+ | normParm=" | ||
+ | fi | ||
+ | |||
+ | if [ $run -eq 0 ]; then | ||
+ | echo " | ||
+ | else | ||
+ | echo " Preparing Source"; | ||
+ | normalize $normParm $inFile; | ||
+ | rate=$(soxi $inFile | grep " | ||
+ | # 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, | ||
+ | # cleanup | ||
+ | rm left.wav right.wav combined.wav source.wav sleft.wav sright.wav | ||
+ | fi | ||
+ | </ | ||
+ | ==== rec ==== | ||
+ | **Rec** permet d' | ||
+ | Pour enregistrer l' | ||
+ | < | ||
+ | Le fichier test.ogg est alors créé dans le répertoire courant. | ||
+ | |||
+ | < | ||
+ | Le fichier ma_voix.wav est créé sur le bureau. | ||
+ | |||
+ | Plus d' | ||
+ | < | ||
+ | |||
+ | Un script pour faciliter l' | ||
+ | |||
+ | ===== Liens ===== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ---- | ||
+ | // | ||
+ |