UNPKG

@vonage/voice

Version:

The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.

134 lines 5.07 kB
import { NCCOActions } from '../../enums'; import { RecordingFormat } from '../../enums'; import { RecordAction } from '../../types'; /** * Represents a Record action in an NCCO. */ export declare class Record implements RecordAction { /** * The action type for the Record action. */ action: NCCOActions.RECORD; /** * The recording format (e.g., "mp3", "wav"). */ format?: RecordingFormat; /** * The split type for recording (always "conversation"). */ protected wrappedSplit?: string; /** * The number of audio channels (1 to 32). */ protected wrappedChannels?: number; /** * The duration of silence (in seconds) to end the recording (3 to 10 seconds). */ protected wrappedEndOnSilence?: number; /** * The DTMF key that ends the recording (e.g., "0", "*", "#"). */ protected wrappedEndOnKey?: string; /** * The maximum recording duration in seconds (3 to 7200 seconds). */ protected wrappedTimeOut?: number; /** * Whether to play a beep before recording starts. */ beepStart?: boolean; /** * The URL where recording events will be sent. */ eventUrl?: string[]; /** * The HTTP method for sending recording events (e.g., "POST"). */ eventMethod?: string; /** * Creates a new Record action. * * @param {RecordingFormat} format - The recording format (e.g., "mp3", "wav"). * @param {string} split - The split type for recording (should be "conversation"). * @param {number} channels - The number of audio channels (1 to 32). * @param {number} endOnSilence - The duration of silence (in seconds) to end the recording (3 to 10 seconds). * @param {string} endOnKey - The DTMF key that ends the recording (e.g., "0", "*", "#"). * @param {number} timeout - The maximum recording duration in seconds (3 to 7200 seconds). * @param {boolean} beepStart - Whether to play a beep before recording starts. * @param {string} eventUrl - The URL where recording events will be sent. * @param {string} eventMethod - The HTTP method for sending recording events (e.g., "POST"). */ constructor(format?: RecordingFormat, split?: string, channels?: number, endOnSilence?: number, endOnKey?: string, timeout?: number, beepStart?: boolean, eventUrl?: string, eventMethod?: string); /** * Getter for the number of audio channels. * * @return {number | undefined} - The current number of audio channels. */ get channels(): number | undefined; /** * Setter for the number of audio channels. * * @param {number} channels - The number of audio channels (1 to 32). * @throws {Error} - If the channel value is invalid or split is not set to "conversation." */ set channels(channels: number); /** * Getter for the character that signals the end of recording. * * @return {string | undefined} - The character that signals the end of recording. */ get endOnKey(): string | undefined; /** * Setter for the DTMF key that ends the recording. * * @param {string} character - The DTMF key that ends the recording (e.g., "0", "*", "#"). * @throws {Error} - If the character is not a valid DTMF key. */ set endOnKey(character: string); /** * Getter for the duration of silence (in seconds) that signals the end of recording. * * @return {number | undefined} - The duration of silence (in seconds) that signals the end of recording. */ get endOnSilence(): number | undefined; /** * Setter for the duration of silence to end the recording. * * @param {number} numSeconds - The duration of silence in seconds (3 to 10 seconds). * @throws {Error} - If the duration value is out of the valid range. */ set endOnSilence(numSeconds: number); /** * Getter for the recording split type. * * @return {string} - The recording split type, which is always 'conversation'. */ get split(): 'conversation'; /** * Setter for the recording split type. * * @param {string} splitType - The recording split type. Must be set to 'conversation'. * @throws {Error} - Throws an error if the splitType is not 'conversation'. */ set split(splitType: string); /** * Getter for the recording timeout duration in seconds. * * @return {number | undefined } - The recording timeout duration in seconds. */ get timeout(): number | undefined; /** * Setter for the recording timeout. * * @param {number} seconds - The maximum recording duration in seconds (3 to 7200 seconds). * @throws {Error} - If the timeout value is out of the valid range. */ set timeout(seconds: number); /** * Serializes the Record action to NCCO format. * * @return {RecordAction} - The serialized Record action. */ serializeToNCCO(): RecordAction; } //# sourceMappingURL=Record.d.ts.map