2. 音声認識
mimi ASR のスタートガイドです。 mimi の音声認識サービスを利用できるようになるまでの手順をまとめています。
Step1 : 事前準備
1. アクセストークンの取得
1. トークンの取得を実行して、アクセストークンを取得してください。この際、音声認識サービスが実行できるようスコープの指定を行い、アクセストークンを払い出すよう注意して下さい。
- 参考:音声認識サービスの URI
- https://apis.mimi.fd.ai/auth/asr/http-api-service
- https://apis.mimi.fd.ai/auth/asr/websocket-api-service
- https://apis.mimi.fd.ai/auth/google-asr/http-api-service
- https://apis.mimi.fd.ai/auth/google-asr/websocket-api-service
- https://apis.mimi.fd.ai/auth/nict-asr/http-api-service
- https://apis.mimi.fd.ai/auth/nict-asr/websocket-api-service
2. 音声認識用のサンプルファイルの取得
サンプル音声のページを参考に、適宜サンプル音声を用意ください。
Step2 : 音声認識サービスの実行
アクセストークンを発行したら、音声認識サービスを実行することができます。以下はHTTPサービスの利用例です。HTTPカスタムヘッダに、必要な設定を記述します。
実行例
mimi ASR powered by NICT を利用する場合の実行例
curl -X POST https://service.mimi.fd.ai \
-H "Content-Type: audio/x-pcm;bit=16;rate=16000;channels=1" \
-H "x-mimi-process:nict-asr" \
-H "x-mimi-input-language:ja" \
-H "Authorization: Bearer <accessToken>" \
--data-binary @/path/to/audio.rawcurl -X POST https://service.mimi.fd.ai \
-H "Content-Type: audio/x-pcm;bit=16;rate=16000;channels=1" \
-H "x-mimi-process:nict-asr" \
-H "x-mimi-input-language:ja" \
-H "x-mimi-nict-asr-options: response_format=v2;progressive=false" \
-H "Authorization: Bearer <accessToken>" \
--data-binary @/path/to/audio.rawmimi ASR を利用する場合の実行例
curl -X POST https://service.mimi.fd.ai \
-H "Content-Type: audio/x-pcm;bit=16;rate=16000;channels=1" \
-H "x-mimi-process:asr" \
-H "Authorization: Bearer <accessToken>" \
--data-binary @/path/to/audio.raw応答例
mimi ASR powered by NICT を利用する場合の応答例
{
"type": "asr#nictlvcsr",
"session_id": "4bc2e829-8c36-456a-a07d-ec6febf0066d",
"status": "recog-finished",
"response": [
{
"result": "とりあえず|トリアエズ|とりあえず|副詞-助詞類接続||||"
},
{
"result": "腹ごしらえ|ハラゴシラエ|腹ごしらえ|名詞-一般||||"
},
{
"result": "|||SENT-START-END||||"
},
{
"result": "|||UTT-END||||"
}
]
}{
"type": "asr#nictlvcsr2",
"session_id": "c18e3c5c-4f39-41aa-bf16-89205a4ca8c3",
"status": "recog-finished",
"response": [
{
"result": "とりあえず腹ごしらえ、",
"words": [
"とりあえず",
"腹ごしらえ"
],
"determined": true,
"time": 450
}
]
}mimi ASR を利用する場合の応答例
{
"response": [
{
"pronunciation": "トリアエズ",
"result": "とりあえず",
"time": [
460,
960
]
},
{
"pronunciation": "ハラゴシラエ",
"result": "腹ごしらえ",
"time": [
960,
1690
]
}
],
"session_id": "b88a1f4e-d72b-11f0-be34-42010a920044",
"status": "recog-finished",
"type": "asr#mimilvcsr"
}音声認識の詳細な情報については mimi ASR のドキュメント および API Reference を参照ください。
Updated about 2 months ago
What’s Next
