运行 google-assistant-demo 时出现以下错误,但在捕获类型下arecord
工作正常:ALSA
file
错误:
(env)pi:~$ google-assistant-demo
ALSA lib pcm.c:7918:(snd_pcm_set_params) Sample format not available for CAPTURE: Invalid argument
[3329:3347:ERROR:audio_input_processor.cc(755)] Input error
ON_MUTED_CHANGED:
{u'is_muted': False}
ON_START_FINISHED
ON_ASSISTANT_ERROR:
{u'is_fatal': True}
[3329:3348:ERROR:audio_input_processor.cc(755)] Input error
ON_ASSISTANT_ERROR:
{u'is_fatal': True}
asoundrc 配置:
pcm.!default
{
type asym
playback.pcm {
type hw
card 0
device 0
}
capture.pcm {
type file
file "/tmp/matrix_micarray_channel_8"
infile "/tmp/matrix_micarray_channel_8"
format "raw"
slave {
pcm dummy
}
}
}
下一行工作正常:
arecord --format=S16_LE --duration=5 --rate=16k --file-type=raw out.raw
aplay --format=S16_LE --rate=16k out.raw