UNPKG

ibm-watson

Version:
51 lines (50 loc) 1.88 kB
/// <reference types="node" /> /// <reference types="node" /> import { OutgoingHttpHeaders } from 'http'; import { UserOptions } from 'ibm-cloud-sdk-core'; import { Readable } from 'stream'; import SynthesizeStream = require('../lib/synthesize-stream'); import GeneratedTextToSpeechV1 = require('./v1-generated'); declare class TextToSpeechV1 extends GeneratedTextToSpeechV1 { constructor(options: UserOptions); /** * Repair the WAV header of an audio/wav file in Stream format. * The Stream is read into memory, then the data is repaired and returned as a Buffer. * * @param {Buffer} wavFileAsStream - wave audio as a stream * @return {Buffer} wavFileData - a Buffer with the correct header */ repairWavHeaderStream: (wavFileAsStream: Readable) => Promise<Buffer>; /** * Repair the WAV header of an audio/wav file. * * @param {Buffer} wavFileData - Wave audio - will be edited in place and returned * @return {Buffer} the original Buffer, with the correct header */ repairWavHeader: (wavFileData: Buffer) => Buffer; /** * Use the synthesize function with a readable stream over websockets * * @param {Object} params The parameters * @return {SynthesizeStream} */ synthesizeUsingWebSocket(params: TextToSpeechV1.SynthesizeWebSocketParams): SynthesizeStream; } declare namespace TextToSpeechV1 { interface SynthesizeWebSocketParams { headers?: OutgoingHttpHeaders; text: string; accept: string; timings?: string[]; accessToken?: string; watsonToken?: string; voice?: string; customizationId?: string; spellOutMode?: string; ratePercentage?: number; pitchPercentage?: number; xWatsonLearningOptOut?: boolean; xWatsonMetadata?: string; } } export = TextToSpeechV1;