라즈베리파이에서 별도의 스피커나 마이크를 위한 디바이스 설정이 필요한 경우 아래와 같이 playback 디바이스와 capture 디바이스를 설정하는 것이 가능하다.
<card number>,<device number>는 aplay -l 명령과 arecord -l 명령으로 확인 가능하다.
pcm.!default { type asym capture.pcm "mic" playback.pcm "speaker" } pcm.mic { type plug slave { pcm "hw:<card number>,<device number>" } } pcm.speaker { type plug slave { pcm "hw:<card number>,<device number>" } }
참고
- https://stackoverflow.com/questions/36208176/arecord-set-params1233-sample-format-non-available-available-formats-s16-l
- https://iotbytes.wordpress.com/connect-configure-and-test-usb-microphone-and-speaker-with-raspberry-pi/
- https://snowdeer.github.io/raspberry/2017/08/12/raspberry-aplay-and-arecord/
- https://developers.google.com/assistant/sdk/guides/service/python/embed/audio