1
0

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.

LINEAR16 ファイルを再生する方法

Posted at

Google Speech API にてストリーミング音声処理を行う場合、 LINEAR16 形式のファイルで認識する。
このファイルには、 .wav ファイルのようにヘッダーに音声情報が乗っているわけではない為、
サンプルレート、エンコード タイプ、チャンネル数を指定する必要がある。

SoX を利用して再生する場合、 '.wav' ファイルならば何も気にせず play ファイル名 を指定すれば良いが、
LINEAR16 は以下のようなコマンドを書く必要がある。

play -t raw --channels=1 --bits=16 --rate=44100 --encoding=signed-integer --endian=little audio_2018-04-09_10-31-57.raw

音声って難しい。

参考:
https://cloud.google.com/speech/docs/support#troubleshooting

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?