

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# StartSpeechSynthesisStream
<a name="API_StartSpeechSynthesisStream"></a>

双方向ストリーミング接続を介して UTF-8 入力、プレーンテキスト、または SSML を合成します。HTTP/2 ヘッダーで合成パラメータを指定し、入力ストリームのイベントとしてテキストを段階的に送信し、使用可能になると合成されたオーディオを受け取ります。

このオペレーションは、 の双方向のカウンターパートとして機能します`SynthesizeSpeech`。
+  [SynthesizeSpeech](https://docs.aws.amazon.com/polly/latest/dg/API_SynthesizeSpeech.html) 

## リクエストの構文
<a name="API_StartSpeechSynthesisStream_RequestSyntax"></a>

```
POST /v1/synthesisStream HTTP/1.1
x-amzn-Engine: Engine
x-amzn-LanguageCode: LanguageCode
x-amzn-LexiconNames: LexiconNames
x-amzn-OutputFormat: OutputFormat
x-amzn-SampleRate: SampleRate
x-amzn-VoiceId: VoiceId
Content-type: application/json

{
   "CloseStreamEvent": { 
   },
   "TextEvent": { 
      "FlushStreamConfiguration": { 
         "Force": boolean
      },
      "Text": "string",
      "TextType": "string"
   }
}
```

## URI リクエストパラメータ
<a name="API_StartSpeechSynthesisStream_RequestParameters"></a>

リクエストでは、次の URI パラメータを使用します。

 ** [Engine](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-Engine"></a>
音声合成の入力テキストを処理するときに Amazon Polly が使用するエンジンを指定します。現在、 `generative` エンジンのみがサポートされています。選択したエンジンがサポートしていない音声を指定すると、Amazon Polly はエラーを返します。  
有効な値：`standard | neural | long-form | generative`  
必須: はい

 ** [LanguageCode](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-LanguageCode"></a>
音声合成リクエストの言語コードを設定するオプションのパラメータ。このパラメータは、バイリンガル音声を使用する場合にのみ指定します。バイリンガル音声の使用時に言語コードが指定されていない場合、Amazon Polly はバイリンガル音声のデフォルト言語を使用します。  
有効な値：`arb | cmn-CN | cy-GB | da-DK | de-DE | en-AU | en-GB | en-GB-WLS | en-IN | en-US | es-ES | es-MX | es-US | fr-CA | fr-FR | is-IS | it-IT | ja-JP | hi-IN | ko-KR | nb-NO | nl-NL | pl-PL | pt-BR | pt-PT | ro-RO | ru-RU | sv-SE | tr-TR | en-NZ | en-ZA | ca-ES | de-AT | yue-CN | ar-AE | fi-FI | en-IE | nl-BE | fr-BE | cs-CZ | de-CH | en-SG`

 ** [LexiconNames](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-LexiconNames"></a>
合成中に適用するサービスの 1 つ以上の発音レキシコンの名前。Amazon Polly は、レキシコン言語が音声言語と一致する場合にのみレキシコンを適用します。  
配列メンバー: 5 つの項目の最大数。  
パターン: `[0-9A-Za-z]{1,20}` 

 ** [OutputFormat](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-OutputFormat"></a>
合成された音声のオーディオ形式。現在、Amazon Polly は JSON スピーチマークをサポートしていません。  
有効な値：`json | mp3 | ogg_opus | ogg_vorbis | pcm`  
必須: はい

 ** [SampleRate](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-SampleRate"></a>
Hz で指定されたオーディオ周波数。

 ** [VoiceId](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-VoiceId"></a>
合成で使用する音声。使用可能な音声 IDs のリストを取得するには、[DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) オペレーションを使用します。  
有効な値：`Aditi | Amy | Astrid | Bianca | Brian | Camila | Carla | Carmen | Celine | Chantal | Conchita | Cristiano | Dora | Emma | Enrique | Ewa | Filiz | Gabrielle | Geraint | Giorgio | Gwyneth | Hans | Ines | Ivy | Jacek | Jan | Joanna | Joey | Justin | Karl | Kendra | Kevin | Kimberly | Lea | Liv | Lotte | Lucia | Lupe | Mads | Maja | Marlene | Mathieu | Matthew | Maxim | Mia | Miguel | Mizuki | Naja | Nicole | Olivia | Penelope | Raveena | Ricardo | Ruben | Russell | Salli | Seoyeon | Takumi | Tatyana | Vicki | Vitoria | Zeina | Zhiyu | Aria | Ayanda | Arlet | Hannah | Arthur | Daniel | Liam | Pedro | Kajal | Hiujin | Laura | Elin | Ida | Suvi | Ola | Hala | Andres | Sergio | Remi | Adriano | Thiago | Ruth | Stephen | Kazuha | Tomoko | Niamh | Sofie | Lisa | Isabelle | Zayd | Danielle | Gregory | Burcu | Jitka | Sabrina | Jasmine | Jihye | Ambre | Beatrice | Florian | Lennart | Lorenzo | Tiffany`  
必須: はい

## リクエストボディ
<a name="API_StartSpeechSynthesisStream_RequestBody"></a>

リクエストは以下の JSON 形式のデータを受け入れます。

 ** [CloseStreamEvent](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-CloseStreamEvent"></a>
入力ストリームの終了を示すイベント。  
型: [CloseStreamEvent](API_CloseStreamEvent.md) オブジェクト  
必須: いいえ

 ** [TextEvent](#API_StartSpeechSynthesisStream_RequestSyntax) **   <a name="polly-StartSpeechSynthesisStream-request-TextEvent"></a>
合成するコンテンツを含むテキストイベント。  
型: [TextEvent](API_TextEvent.md) オブジェクト  
必須: いいえ

## レスポンスの構文
<a name="API_StartSpeechSynthesisStream_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "AudioEvent": { 
      "AudioChunk": blob
   },
   "ServiceFailureException": { 
   },
   "ServiceQuotaExceededException": { 
   },
   "StreamClosedEvent": { 
      "RequestCharacters": number
   },
   "ThrottlingException": { 
   },
   "ValidationException": { 
   }
}
```

## レスポンス要素
<a name="API_StartSpeechSynthesisStream_ResponseElements"></a>

アクションが成功すると、サービスは HTTP 200 レスポンスを返します。

サービスから以下のデータが JSON 形式で返されます。

 ** [AudioEvent](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-AudioEvent"></a>
合成された音声を含むオーディオイベント。  
型: [AudioEvent](API_AudioEvent.md) オブジェクト

 ** [ServiceFailureException](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-ServiceFailureException"></a>
不明な状態が原因で、サービス障害が発生しました。  
タイプ: Exception  
HTTP ステータスコード: 500

 ** [ServiceQuotaExceededException](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-ServiceQuotaExceededException"></a>
サービスクォータを超えることを示す例外。  
タイプ: Exception  
HTTP ステータスコード: 402

 ** [StreamClosedEvent](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-StreamClosedEvent"></a>
ストリームが閉じられたことを示す概要情報を含むイベント。  
型: [StreamClosedEvent](API_StreamClosedEvent.md) オブジェクト

 ** [ThrottlingException](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-ThrottlingException"></a>
リクエストがスロットリングされたことを示す例外。  
タイプ: Exception  
HTTP ステータスコード: 400

 ** [ValidationException](#API_StartSpeechSynthesisStream_ResponseSyntax) **   <a name="polly-StartSpeechSynthesisStream-response-ValidationException"></a>
入力が検証に失敗したことを示す例外。  
タイプ: Exception  
HTTP ステータスコード: 400

## エラー
<a name="API_StartSpeechSynthesisStream_Errors"></a>

 ** ServiceFailureException **   
不明な状態が原因で、サービス障害が発生しました。  
HTTP ステータスコード: 500

 ** ServiceQuotaExceededException **   
リクエストにより、サービスクォータが超過します。    
 ** quotaCode **   
特定のクォータを識別するクォータコード。  
 ** serviceCode **   
発信元サービスを識別するサービスコード。
HTTP ステータスコード: 402

 ** ThrottlingException **   
リクエストスロットリングのため、リクエストが拒否されました。    
 ** throttlingReasons **   
リクエストがスロットリングされた理由のリスト。
HTTP ステータスコード: 400

 ** ValidationException **   
入力が、 サービスで指定された制約を満たしていません。    
 ** fields **   
検証エラーの原因となったフィールド。  
 ** reason **   
リクエストが検証に失敗した理由。
HTTP ステータスコード: 400

## 以下の資料も参照してください。
<a name="API_StartSpeechSynthesisStream_SeeAlso"></a>

言語固有の AWS SDKs のいずれかでこの API を使用する方法の詳細については、以下を参照してください。
+  [AWS コマンドラインインターフェイス V2](https://docs.aws.amazon.com/goto/cli2/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/polly-2016-06-10/StartSpeechSynthesisStream) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/polly-2016-06-10/StartSpeechSynthesisStream) 