{% method %}
Speak text or play audio to ONLY a single conference member.
POST
https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/members/{memberId}/audio
Parameter | Description | Mandatory |
---|---|---|
fileUrl | The location of an audio file to play (WAV and MP3 supported). To STOP AUDIO FILE PLAYBACK send an empty string like: {"fileUrl": ""} |
* |
sentence | The sentence to speak MAXIMUM LENGTH 1000 CHARACTERS. To STOP SENTENCE PLAYBACK send an empty string like: {"sentence": ""} |
* |
gender | The gender of the voice used to synthesize the sentence. It will be considered only if sentence is not null. The female gender will be used by default. | No |
locale | The locale used to get the accent of the voice used to synthesize the sentence. Currently audio supports: - en_US or en_UK (English) - es or es_MX (Spanish) - fr or fr_FR (French) - de or de_DE (German) - t or it_IT (Italian) It will be considered only if sentence is not null/empty. The en_US will be used by default. |
No |
voice | The voice to speak the sentence. Audio currently supports the following voices: - English US: Kate, Susan, Julie, Dave, Paul - English UK: Bridget - Spanish: Esperanza, Violeta, Jorge - French: Jolie, Bernard - German: Katrin, Stefan - Italian: Paola, Luca It will be considered only if sentence is not null/empty. Susan’s voice will be used by default. |
No |
loopEnabled | When value is true , the audio will keep playing in a loop. Default: false . |
No |
tag | A string that will be included in the events delivered when the audio playback starts or finishes. | No |
* For playing text-to-speech, sentence is required, for playing an audio file, fileUrl is required.
{% common %}
{% sample lang="bash" %}
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/members/{memberId}/audio -u {token}:{secret} -H "Content-type: application/json" -d
'
{
"sentence": "Hi there member, I have a message only for you",
"gender": "female",
"locale": "en_US",
"voice": "kate"
}
'
{% sample lang="js" %}
//Speak sentence
//Promise
client.Conference.speakSentenceToMember("conferenceID", "memberID", "Hello From Bandwidth")
.then(function (res) {});
//Callback
client.Conference.speakSentenceToMember("conferenceID", "memberID", "Hello From Bandwidth",
function (err, res) {});
//Speak sentence with options
var options = {
sentence : "hola de Bandwidth",
gender : "male",
locale : "es",
voice : "Jorge"
}
//Promise
client.Conference.playAudioAdvancedToMember("conferenceId", "memberId", options)
.then(function (res) {});
//Callback
client.Conference.playAudioAdvanced("conferenceId", options, function (err,res) {});
{% sample lang="csharp" %}
//Speak sentence with options
await client.Conference.PlayAudioToMemberAsync("{conferenceId1}", "{memberId1}", new PlayAudioData
{
Sentence = "hola de Bandwidth",
Gender = Gender.Male,
Voice = "Jorge",
Locale = "es"
});
//Speak sentence in a conference
await client.Conference.SpeakSentenceToMemberAsync("{conferenceId1}", "{memberId1}", "Hello From Bandwidth");
{% sample lang="ruby" %}
member.speak_sentence(:sentence => "Hello From Bandwidth")
{% sample lang="bash" %}
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/members/{memberId}/audio -u {token}:{secret} -H "Content-type: application/json" -d
'
{
"fileUrl": "https://catapult.inetwork.com/.../media/{mediaName1}"
}
'
{% sample lang="js" %}
//Play Audio file
//Promise
client.Conference.playAudioFileToMember("conferenceID", "memberId", "http://myurl.com/file.mp3")
.then(function (res) {});
//Callback
client.Conference.playAudioFileToMember("conferenceID", "memberId", "http://myurl.com/file.wav",
function (err, res) {});
//Play Audio File on loop
var options = {
fileUrl : "http://myurl.com/file.mp3",
loopEnabled : true
}
//Promise
client.Conference.playAudioAdvancedToMember("conferenceId", "memberId", options)
.then(function (res) {});
//Callback
client.Conference.playAudioAdvancedToMember("conferenceId", "memberId", options,
function (err,res) {});
{% sample lang="csharp" %}
//Play audio file with options
await client.Conference.PlayAudioToMemberAsync("{conferenceId1}", "{memberId1}", new PlayAudioData
{
FileUrl = "http://myurl.com/file.mp3",
LoopEnabled = true
});
//Speak sentence in a conference
await client.Conference.PlayAudioFileToMemberAsync("{conferenceId1}", "{memberId1}", "http://myurl.com/file.mp3");
{% sample lang="ruby" %}
member.play_audio(:file_url => "http://host1")
{% endmethod %}