5
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry Pi 3B + BluetoothスピーカでAmazon Alexaを安く構築(2 マイクで音を拾う)

Last updated at Posted at 2017-12-30

前章の続きで、ラズパイをAmazon Echo化したいと思います。

本章:こんどはできるだけ安いマイクで音を拾いたい

購入品

  • USBマイク 650円
    (下記の記事より高かったのは悔しいですが、同じことができそうです)

まずは指す

上の記事にあるとおり、まずは指すだけで新しいデバイスが認識されます。

i@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 8086:0808 Intel Corp.

録音コマンドでカード番号、デバイス番号を調べます。

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

カード番号1, デバイス番号0です。

録音

amixerで録音音量を上げます。

$ amixer sset Mic 16 -c 1
Simple mixer control 'Mic',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 16
  Mono: Capture 16 [100%] [23.81dB] [on]

arecordで録音します。ビットレートは-fで指定します。Ctrl+cで録音中止します。

$ arecord -f S16_LE -D plughw:1,0 test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
^CAborted by signal Interrupt...
arecord: pcm_read:2031: read error: Interrupted system call

再生するとたしかに音が録音されています。

aplay test.wav

マイクに関しての結論(購入時に注意)

今回購入したのはこちらのUSBマイクでした。
USBマイク@Amazon

でも結果から言うと、最大音量に設定し結構大きな声でしゃべっても、1m離れると拾ってくれません。Amazon Echo本家を購入して使用した実績では4,5m離れても普通の声を拾ってくれることと比べるととてもおそまつです。
したがって、Amazon Echoを再現するという目的にはあまり適していなかったことが分かりました。

今回は30cm程離れたところから比較的声を張って、以降の検証を実施したいと思います。

次は

いよいよAmazon Voice Service (AVS)を入れて、「Alexa」と呼び掛けたいと思います。

5
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?