会話型アクションのサポートは 2023 年 6 月 13 日に終了しました。詳細については、
会話型アクションの廃止をご覧ください。
音声に関するベスト プラクティス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このページでは、Google Assistant API に音声データを提供する際のおすすめの方法について説明します。これらのガイドラインは、効率性と正確性を高め、サービスからの妥当な応答時間を実現することを目的としています。
音声の前処理
高音質の適切な位置に置かれたマイクを使用して、可能な限り明瞭な音声を生成することをおすすめします。ただし、音声をサービスに送信する前にノイズ低減信号処理を適用すると、一般に認識精度が低下します。このサービスはノイズのある音声を処理するように設計されています。
最良の結果を得るために、次のことを行います。
- 特にバックグラウンド ノイズがある場合には、できる限りユーザーの近くにマイクを置きます。
- 音声のクリッピングを避けます。
- 自動利得制御(AGC)の使用を避けます。
- すべてのノイズ低減処理を無効にします。
次のようにするのが理想的です。
- 入力信号がクリップされず、音声のピークレベルが約 -20 ~-10 dBFS に達するように音声レベルを調整する必要があります。
- デバイスは、ほぼ「フラット」な振幅周波数特性(+- 3 dB、100 Hz ~ 8,000 Hz)を示す必要があります。
- 高調波ひずみの合計は、SPL 入力レベル 90 dB で、100 Hz から 8,000 Hz の 1% 未満にする必要があります。
サンプリング レート
可能であれば、音源のサンプリング レートを 16,000 Hz に設定します。それ以外の場合は、(再サンプリングするのではなく)音源のネイティブ サンプルレートと一致するように sample_rate_hertz
を設定します。
フレームサイズ
Google アシスタントは、マイクからキャプチャされたライブ音声を認識します。音声ストリームはフレームに分割し、連続する AssistRequest
メッセージで送信する必要があります。フレームサイズは任意のサイズにすることができます。フレームが大きいほど効率は向上しますが、レイテンシが増加します。レイテンシと効率の適切なトレードオフとして、100 ミリ秒フレームサイズをおすすめします。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eThis page provides recommendations for submitting speech data to the Google Assistant API for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eFor best results, use a high-quality microphone, position it close to the user, avoid audio clipping and noise reduction processing, and disable automatic gain control.\u003c/p\u003e\n"],["\u003cp\u003eIdeally, calibrate audio levels to prevent clipping, maintain a flat frequency response, and minimize harmonic distortion.\u003c/p\u003e\n"],["\u003cp\u003eSet the audio source sampling rate to 16000 Hz if possible, or match the native rate, and use a frame size of around 100 milliseconds for a balance between latency and efficiency.\u003c/p\u003e\n"]]],[],null,["# Best Practices for Audio\n\nThis page contains recommendations on how to provide speech data to the\nGoogle Assistant API. These guidelines are designed for greater efficiency\nand accuracy as well as reasonable response times from the service.\n\nAudio pre-processing\n--------------------\n\nIt's best to provide audio that is as clean as possible by using a good quality\nand well-positioned microphone. However, applying noise-reduction signal\nprocessing to the audio before sending it to the service typically reduces\nrecognition accuracy. The service is designed to handle noisy audio.\n\nFor best results:\n\n- Position the microphone as close to the user as possible, particularly when background noise is present.\n- Avoid audio clipping.\n- Do not use automatic gain control (AGC).\n- All noise reduction processing should be disabled.\n\nIdeally:\n\n- The audio level should be calibrated so that the input signal does not clip, and peak speech audio levels reach approximately -20 to -10 dBFS.\n- The device should exhibit approximately \"flat\" amplitude versus frequency characteristics (+- 3 dB 100 Hz to 8000 Hz).\n- Total harmonic distortion should be less than 1% from 100 Hz to 8000 Hz at 90 dB SPL input level.\n\nSampling rate\n-------------\n\nIf possible, set the sampling rate of the audio source to 16000 Hz. Otherwise,\nset the [`sample_rate_hertz`](/assistant/sdk/reference/rpc/google.assistant.embedded.v1alpha2#google.assistant.embedded.v1alpha2.AudioInConfig) to match the native sample rate of the audio source (instead\nof re-sampling).\n\nFrame size\n----------\n\nThe Google Assistant recognizes live audio as it is captured from a microphone.\nThe audio stream must be split into frames and sent in consecutive\n`AssistRequest` messages. Any frame size is acceptable. Larger frames are more\nefficient, but add latency. A 100-millisecond frame size is recommended as a\ngood tradeoff between latency and efficiency."]]