次の方法で共有


Call Media - Play

通話の参加者に音声を再生します。

POST {endpoint}/calling/callConnections/{callConnectionId}:play?api-version=2024-09-15

URI パラメーター

名前 / 必須 説明
callConnectionId
path True

string

呼び出し接続 ID。

endpoint
path True

string

url

Azure Communication リソースのエンドポイント。

api-version
query True

string

呼び出す API のバージョン。

要求ヘッダー

名前 必須 説明
Authorization True

string

Azure Communication Services ユーザー アクセス トークン。

要求本文

名前 必須 説明
playSources True

PlaySource[]

再生するオーディオのソース。

interruptCallMediaOperation

boolean

セットプレイが他の既存のキューアップ/現在処理中の要求に割り込むことができる場合。

operationCallbackUri

string

この操作の CreateCall/AnswerCall によって設定された既定のコールバック URI をオーバーライドするコールバック URI を設定します。 このセットアップはアクションごとに行われます。 これが設定されていない場合は、CreateCall/AnswerCall によって設定された既定のコールバック URI が使用されます。

operationContext

string

操作のコンテキストを識別する値。

playOptions

PlayOptions

オーディオを再生するためのオプションを定義します。

playTo

CommunicationIdentifierModel[]

通話参加者の一覧は、提供されたオーディオを再生します。 指定されていない場合は、通話中のすべてのユーザーに再生されます。

応答

名前 説明
202 Accepted

サービスはプレイ要求を受け入れ、処理を開始します。 指定したコールバック URI で PlayCompleted または PlayFailed イベントを受け取り、要求の状態を更新します。

Other Status Codes

CommunicationErrorResponse

エラー

セキュリティ

Authorization

Azure Communication Services ユーザー アクセス トークン。

型: apiKey
/: header

CallMedia_Play

要求のサンプル

POST https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c:play?api-version=2024-09-15

{
  "playSources": [
    {
      "kind": "file",
      "playSourceCacheId": "string",
      "file": {
        "uri": "https://some.file.azure.com/sample.wav"
      }
    }
  ],
  "playTo": [
    {
      "kind": "communicationUser",
      "communicationUser": {
        "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_ae9e3307-f56e-44be-8934-80a63f080538"
      }
    }
  ],
  "playOptions": {
    "loop": true
  },
  "operationCallbackUri": "https://app.contoso.com/callback"
}

応答のサンプル

定義

名前 説明
FileSource
PlayOptions
PlayRequest
PlaySource
PlaySourceType

再生ソースの種類を定義します

SsmlSource
TextSource
VoiceKind

音声の種類

FileSource

名前 説明
uri

string

再生するオーディオ ファイルの URI

PlayOptions

名前 説明
loop

boolean

true に設定されている場合に、指定されたオーディオ ソースをループで再生するオプション

PlayRequest

名前 説明
interruptCallMediaOperation

boolean

セットプレイが他の既存のキューアップ/現在処理中の要求に割り込むことができる場合。

operationCallbackUri

string

この操作の CreateCall/AnswerCall によって設定された既定のコールバック URI をオーバーライドするコールバック URI を設定します。 このセットアップはアクションごとに行われます。 これが設定されていない場合は、CreateCall/AnswerCall によって設定された既定のコールバック URI が使用されます。

operationContext

string

操作のコンテキストを識別する値。

playOptions

PlayOptions

オーディオを再生するためのオプションを定義します。

playSources

PlaySource[]

再生するオーディオのソース。

playTo

CommunicationIdentifierModel[]

通話参加者の一覧は、提供されたオーディオを再生します。 指定されていない場合は、通話中のすべてのユーザーに再生されます。

PlaySource

名前 説明
file

FileSource

再生に使用するファイル ソース情報を定義します

kind

PlaySourceType

再生ソースの種類を定義します

playSourceCacheId

string

関連メディアのキャッシュに使用する識別子を定義します

ssml

SsmlSource

再生に使用する ssml(Speech Synthesis Markup Language) ソース情報を定義します

text

TextSource

再生に使用するテキスト ソース情報を定義します

PlaySourceType

再生ソースの種類を定義します

名前 説明
file

string

ssml

string

text

string

SsmlSource

名前 説明
customVoiceEndpointId

string

カスタム音声がデプロイされたエンドポイント。

ssmlText

string

再生するコグニティブ サービスの Ssml 文字列

TextSource

名前 説明
customVoiceEndpointId

string

カスタム音声がデプロイされたエンドポイント。

sourceLocale

string

再生するソース言語ロケール ここで使用可能なロケールを参照してください。

text

string

再生するコグニティブ サービスのテキスト

voiceKind

VoiceKind

音声の種類

voiceName

string

再生する音声名 ここで使用可能なテキスト読み上げ音声を参照してください。

VoiceKind

音声の種類

名前 説明
female

string

male

string