在树莓派3和MATRIX Creator话筒阵列

时间:2017-07-31 22:53:36

标签: raspberry-pi3 google-assistant-sdk google-assist-api

运行google-assistant-demo时出现以下错误,arecordALSA捕获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 config:

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

1 个答案:

答案 0 :(得分:0)

将asoundrc复制到root。在我的案例中工作。祝你好运。