イヤーマフ
このコードスニペットは、通話にイヤーマフとアニアーマフをかける。通話がイヤーマフされると、ユーザーは他の参加者の声を聞くことができないが、他の参加者はユーザーの声を聞くことができる。
例
サンプルコードの以下の変数を置き換える:
| キー | 説明 |
|---|---|
VOICE_CALL_ID | The UUID of the call leg. |
Prerequisites
Execute the following command at your terminal prompt to create the JWT for authentication:
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named earmuff-a-call.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Create a class named EarmuffCall and add the following code to the main method:
Run your code
We can use the アプリケーション plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.voice with the package containing EarmuffCall:
Prerequisites
Add the following to build.gradle:
Create a class named EarmuffCall and add the following code to the main method:
VonageClient client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();Write the code
Add the following to the main method of the EarmuffCall class:
client.getVoiceClient().earmuffCall(VOICE_CALL_ID);
Thread.sleep(3000);
client.getVoiceClient().unearmuffCall(VOICE_CALL_ID);Run your code
We can use the アプリケーション plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.voice with the package containing EarmuffCall:
Prerequisites
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
試してみる
コードを実行すると、UUIDで識別される呼び出しがイヤーマフまたはアンイヤーマフされる。
さらに読む
- 電話会議 - このガイドでは、Vonageが通話に関連付ける2つの概念、レグと会話について説明します。