Play audio in Conference

Speak a text or play audio in the conference

Request URL

POSThttps://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/audio


Supported Parameters

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": ""}
No
sentence The sentence to speak MAXIMUM LENGTH 1000 CHARACTERS.

To STOP SENTENCE PLAYBACK send an empty string like: {"sentence": ""}
No
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

Example 1 of 4: Speak text in conference

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/audio \
    -u {token}:{secret} \
    -H "Content-type: application/json" \
    -d \
    '
    {
        "sentence": "Hello everyone on the conference today",
        "gender": "female",
        "locale": "en_US",
        "voice": "kate"
    }'
//Speak sentence in a conference
//Promise
client.Conference.speakSentence("conferenceID", "Hello From Bandwidth").then(function (res) {});
//Callback
client.Conference.speakSentence("conferenceID", "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.playAudioAdvanced("conferenceId", options).then(function (res) {});

//Callback
client.Conference.playAudioAdvanced("conferenceId", options, function (err,res) {});
// Speak sentence in a conference
await client.Conference.SpeakSentenceAsync("{conferenceId1}", "Hello From Bandwidth");

// Speak sentence with options
await client.Conference.PlayAudioAsync("{conferenceId1}", new PlayAudioData {
    Sentence = "hola de Bandwidth",
    Gender = Genger.Male,
    Voice = "Jorge",
    Locale = "es"
});
conference.play_audio({
    :sentence => "hola de Bandwidth",
    :gender => "male",
    :voice => "Jorge",
    :locale => "es"
})

Example 2 of 4: Interrupt/Stop a sentence from speaking

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/audio \
    -u {token}:{secret} \
    -H "Content-type: application/json" \
    -d '{"sentence": ""}'
//Speak sentence in a conference
//Promise
client.Conference.stopSpeaking("conferenceID").then(function (res) {});
//Callback
client.Conference.stopSpeaking("conferenceID", function (err, res) {});

//Speak sentence with options
var options = {sentence : ""}
//Promise
client.Conference.playAudioAdvanced("conferenceId", options).then(function (res) {});

//Callback
client.Conference.playAudioAdvanced("conferenceId", options, function (err,res) {});
// Speak sentence in a conference
await client.Conference.SpeakSentenceAsync("{conferenceId1}", "");

// Speak sentence with options
await client.Conference.PlayAudioAsync("{conferenceId1}", new PlayAudioData {Sentence = ""});
conference.play_audio({:sentence => ""})

Example 3 of 4: Play audio in conference

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/audio \
    -u {token}:{secret} \
    -H "Content-type: application/json" \
    -d \
    '
    {
        "fileUrl": "https://catapult.inetwork.com/.../media/{mediaName1}"
    }'
//Play Audio file on conference
//Promise
client.Conference.playAudioFile("conferenceID", "http://myurl.com/file.mp3").then(function (res) {});
//Callback
client.Conference.playAudioFile("conferenceID", "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.playAudioAdvanced("conferenceId", options).then(function (res) {});
//Callback
client.Conference.playAudioAdvanced("conferenceId", options, function (err,res) {});
// Play audio file in a conference
await client.Conference.PlayAudioFileAsync("{conferenceId1}", "http://myurl.com/file.mp3");

// Play audio file with options
await client.Conference.PlayAudioAsync("{conferenceId1}", new PlayAudioData {
    FileUrl = "http://myurl.com/file.mp3",
    LoopEnabled = true
});
conference.play_audio({
    :file_url => "http://myurl.com/file.mp3"
})

Example 4 of 4: Stop an Audio File Playing in Conference

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{userId}/conferences/{conferenceId}/audio \
    -u {token}:{secret} \
    -H "Content-type: application/json" \
    -d '{"fileUrl": ""}'
//Promise
client.Conference.stopAudioFilePlayback("conferenceID").then(function (res) {});
//Callback
client.Conference.stopAudioFilePlayback("conferenceID", function (err, res) {});

var options = {
    fileUrl     : ""
}
//Promise
client.Conference.playAudioAdvanced("conferenceId", options).then(function (res) {});
//Callback
client.Conference.playAudioAdvanced("conferenceId", options, function (err,res) {});
// Play audio file in a conference
await client.Conference.PlayAudioFileAsync("{conferenceId1}", "");

// Play audio file with options
await client.Conference.PlayAudioAsync("{conferenceId1}", new PlayAudioData {FileUrl = ""});
conference.play_audio({:file_url => ""})

results matching ""

    No results matching ""