## Gua rpida de prcticas de Imagen y Sonido.
## Control del mezclador de audio de la tarjeta de sonido
alsamixer # (1) instalar alsa
−utils y (2) ejecutar alsaconf
## Captura de un fichero WAV
arecord
−f cd
> file.wav
## Reproduccin de un fichero WAV
aplay
< file.wav
## Visualizacin (y tratamiento) de ficheros WAV (instalar wavesurfer)
wavesurfer file.wav
## Edicin y procesamiento de ficheros WAV
wavesurfer file.wav # instalar wavesurfer
audacity file.wav # instalar audacity
# Captura de un fichero MP3
arecord
−f cd
| lame
− − > file.mp3
# Reproduccin de un fichero MP3
mpg321
− < file.mp3
## Captura de un fichero OGG (paquete vorbis
−tools)
arecord
−f cd
| oggenc
− > file.ogg
## Reproduccin de un fichero OGG
oggdec
− −o
− < file.ogg
| aplay
−f cd
ogg123
− < file.ogg
## Captura de un fichero FLAC (instalar paquete flac)
arecord
−f cd
| flac
− −c
> file.flac
## Reproduccin de un fichero FLAC
flac
− −d
−c
< file.flac
| aplay
## Captura de un fichero RAW
arecord
−t raw
−f cd
> file.raw
## Reproduccin de un fichero RAW
aplay
−t raw
−f cd
< file.raw
## Conversin de un fichero RAW a WAV
wav2cdr
−−towav
< file.raw
> file.wav
## Conversin de un fichero WAV a RAW
wav2cdr
−−toraw
−−outlittle
< file.wav
> file.raw
## Reproduccin de ruido blanco
aplay
−t raw
−f cd
< /dev/urandom
## Reproduccin del silencio absoluto
aplay
−t raw
−f cd
< /dev/zero
## Registrando para nada
arecord
−f cd
−t raw
> /dev/null
## Reproduccin de una seal sinusoidal
oscillator
| aplay
−t raw
−f cd
## Escalado en amplitud de una seal
oscillator
| scale
| aplay
−t raw
−f cd
## Captura y reproduccin simultnea de audio
arecord
−f cd
| aplay
−f cd
## Capturando, pero controlando el volumen de grabacin
arecord
−t raw
−f cd
> file.raw &
arecord
−t raw
−f cd
| java volmeter
## Visualizando el volumen de grabacin de un fichero MP3 mientras se reproduce
mpg321 file.mp3
−s
| ./send localhost
| aplay
−t raw
−f cd &
receive
| java volmeter
# Dos personas, cada una en un host, conversan entre s
host1: arecord
−t raw
−f cd
| oggenc
− | send 6666
> /dev/null &
host1: receive host2 6666
| oggdec
− | aplay
−t raw
−f cd
host2: arecord
−t raw
−f cd
| oggenc
− | send 6666
> /dev/null &
host2: receive host1 6666
| oggdec
− | aplay
−t raw
−f cd
# Tres personas, cada una en un host, conversan entre s
host1: arecord
−t raw
−f cd
| oggenc
− | send host2
| send host3
> /dev/null &
host1: receive host2
| oggdec
− | aplay
−t raw
−f cd
host1: receive host3
| oggdec
− | aplay
−t raw
−f cd
host2: arecord
−t raw
−f cd
| oggenc
− | send host1
| send host3
> /dev/null &
host2: receive host1
| oggdec
− | aplay
−t raw
−f cd
host2: receive host3
| oggdec
− | aplay
−f cd
host3: arecord
−f cd
| oggenc
− | send host1
| send host2
> /dev/null &
host3: receive host1
| oggdec
− | aplay
−f cd
host3: receive host2
| oggdec
− | aplay
# Captura de audio en un equipo y reproduccin en otro
localhost$ rec
| send remotehost receive_port
> /dev/null
remotehost$ receive receive_port
| play
# Captura de audio en un equipo y reproduccin en dos
localhost$ rec
| send remotehost receive_port
| play
remotehost$ receive receive_port
| play
# Captura y reproduccin en un equipo y visualizacin del espectro en otro
localhost$ rec
| send remotehost receive_port
| play
remotehost$ receive receive_port
| java RTASA
# Captura en un equipo. Reproduccin del audio y visualizacin del espectro en otro
localhost$ rec
| send remotehost receive_port
> /dev/null
remotehost$ receive receive_port
| send localhost remote_port2
| java RTASA &
remotehost$ receive receive_port2
| play
# Captura en un equipo. Reproduccin en dos equipos remotos.
localhost$ rec
| send remotehost1 receive_port
| send remotehost2 receive_port
> /dev/null
remotehost1$ receive receive_port
| play
remotehost2$ receive receive_port
| play
# Mezcla de seales
Ver ecasound.
ecasound
−f:16,2,48000
−B rtlowlatency
−b 128
−i alsahw,0,0
−o alsahw,0,0
ecasound
−f:16,2,48000
−B rtlowlatency
−b 128
−i alsahw,0,0
−o alsahw,0,0
−ea:100
−kos:1,0,100,0.5,0
−kx
−kos:4,0.1,5,0.5,0
# Probar:
% http://aaron.boim.com/unix/audioRecording.html
sox
nice sox
arecord
−f cd
−t wav
| sox
−t wav
− −t raw
− > 1
## Procesamiento on
−line de la seal de audio
arecord
−f cd
−t raw
| modulator
| aplay
−f cd
−t raw &
java modulator