@vonage/voice
Version:
The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.
49 lines (46 loc) • 1.57 kB
text/typescript
import { NCCOActions } from '../../enums/NCCOActions.mjs';
import { StreamAction } from '../../types/NCCO/StreamAction.mjs';
import { Serializable } from '../../interfaces/NCCO/Serializable.mjs';
/**
* Represents a Stream action in a Nexmo Call Control Object (NCCO).
*
* This action allows streaming audio into the call.
*/
declare class Stream implements StreamAction, Serializable {
/**
* The action type for this NCCO action.
*/
action: NCCOActions.STREAM;
/**
* An array of stream URLs to play audio from.
*/
streamUrl: string[];
/**
* The audio level at which to play the stream (optional).
*/
level?: number;
/**
* Indicates whether the stream should allow barge-in (optional).
*/
bargeIn?: boolean;
/**
* The number of times to loop the audio (optional).
*/
loop?: number;
/**
* Creates a new Stream action.
*
* @param {string} streamUrl - The URL of the audio stream.
* @param {number} [level] - The audio level at which to play the stream (optional).
* @param {boolean} [bargeIn] - Indicates whether the stream should allow barge-in (optional).
* @param {number} [loop] - The number of times to loop the audio (optional).
*/
constructor(streamUrl: string, level?: number, bargeIn?: boolean, loop?: number);
/**
* Serializes the Stream action to a Nexmo Call Control Object (NCCO).
*
* @return {StreamAction} - The serialized Stream action.
*/
serializeToNCCO(): StreamAction;
}
export { Stream };