My Pi 3 Install Log (4): Audio config on Raspbian
Notes reading book pi for secret agents
{
# pi audio setup
cat /proc/asound/cards
ls -l /proc/asound
alsamixer
amixer cset numid=3 1: # set audio out to 3.5mm analog jack
amixer cset numid=3 2: # set audio out to HDMI cable
# test speakers
speaker-test -c2 -t wav
alsamixer -c1 # card 1
# test microphone
sudo apt-get install sox libsox-fmt-mp3
sox -t alsa plughw:1 -d # start a monitoring loop
# writing to a WAV file
sox -t alsa plughw:1 myrec.wav # record
sox myrec.wav -d # playback
sox myrec.wav -t alsa plughw:1 # playback from usb audio device output
# mp3 and ogg
sudo apt-get install lame vorbis-tools
lame myrec.wav # wav -> mp3
oggenc myrec.wav # wav -> ogg
sox -t alsa plughw:1 -t wav - | lame - myrec.mp3 # record as mp3
sox -t alsa plughw:1 -t wav - | oggenc - -o myrec.ogg # record as ogg
sox myrec.mp3 -d # playback mp3
# shortcut
alias record='sox -t alsa plughw:1 -t wav - | lame -'
record newrec.mp3
# terminal multiplex
sudo apt-get install tmux
# what is
sudo nano /boot/cmdline.txt}
From github a japanese shared, pi's audio recording
{
apt-get install alsa-utils # what for
lsusb # list usb devices
arecord -l # list of CAPTURE hardware devices
export AUDIODRIVER=alsa
AUDIODEV=plughw:1,0 rec test.mp3
AUDIODEV=plughw:0,0 play test.mp3
AUDIODEV=plughw:1,0 play test.mp3
}
On my pi then do,
$ sudo apt-get install sox libsox-fmt-mp3 alsa-utils lame vorbis-tools
# alsa already exists on raspbian
$ sudo apt-get install tmux flac
my preferred format flac now played by sox, too. But board 3.5mm bad quality - quite noticeable electrical noise.
Using alsamixer my soundblaster usb soundcard was recognized but tried sox a flac no sound. This is what I want to make it works.
Labels: audio, Raspberry Pi
0 Comments:
Post a Comment
<< Home