From 7d076bb8b4aace588fffcb9f64714ff88662f840 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 17 Jun 2026 16:20:00 -0400 Subject: [PATCH] chore: deprecate + remove verbio, nuance, playht speech vendor support (#144) * chore: deprecate and remove verbio, nuance speech vendor support Co-Authored-By: Claude Opus 4.8 (1M context) * chore: also deprecate and remove PlayHT speech vendor PlayHT was acquired and no longer provides the service. Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) --- build_stubs.sh | 11 - index.js | 2 - lib/get-nuance-access-token.js | 49 - lib/get-tts-voices.js | 94 +- lib/get-verbio-token.js | 51 - lib/synth-audio.js | 261 +- lib/utils.js | 102 +- package-lock.json | 15 +- package.json | 2 - protos/nuance/synthesizer.proto | 332 -- stubs/nuance/synthesizer_grpc_pb.js | 104 - stubs/nuance/synthesizer_pb.js | 6815 --------------------------- test/index.js | 1 - test/list-voices.js | 93 - test/nuance.js | 81 - test/synth.js | 158 - 16 files changed, 9 insertions(+), 8162 deletions(-) delete mode 100755 build_stubs.sh delete mode 100644 lib/get-nuance-access-token.js delete mode 100644 lib/get-verbio-token.js delete mode 100644 protos/nuance/synthesizer.proto delete mode 100644 stubs/nuance/synthesizer_grpc_pb.js delete mode 100644 stubs/nuance/synthesizer_pb.js delete mode 100644 test/nuance.js diff --git a/build_stubs.sh b/build_stubs.sh deleted file mode 100755 index 050eca5..0000000 --- a/build_stubs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -mkdir -p stubs/nuance - -for FILE in ./protos/nuance/*; do - grpc_tools_node_protoc \ - --js_out=import_style=commonjs,binary:./stubs/nuance \ - --grpc_out=grpc_js:./stubs/nuance \ - --proto_path=./protos/nuance \ - $FILE -done diff --git a/index.js b/index.js index 2cff29d..0a3bd94 100644 --- a/index.js +++ b/index.js @@ -14,8 +14,6 @@ module.exports = (opts, logger) => { purgeTtsCache: require('./lib/purge-tts-cache').bind(null, client, logger), addFileToCache: require('./lib/add-file-to-cache').bind(null, client, logger), synthAudio: require('./lib/synth-audio').bind(null, client, createHash, retrieveHash, logger), - getVerbioAccessToken: require('./lib/get-verbio-token').bind(null, client, logger), - getNuanceAccessToken: require('./lib/get-nuance-access-token').bind(null, client, logger), getAwsAuthToken: require('./lib/get-aws-sts-token').bind(null, logger, createHash, retrieveHash), getTtsVoices: require('./lib/get-tts-voices').bind(null, client, createHash, retrieveHash, logger), diff --git a/lib/get-nuance-access-token.js b/lib/get-nuance-access-token.js deleted file mode 100644 index 519516d..0000000 --- a/lib/get-nuance-access-token.js +++ /dev/null @@ -1,49 +0,0 @@ -const formurlencoded = require('form-urlencoded'); -const {Pool} = require('undici'); -const pool = new Pool('https://auth.crt.nuance.com'); -const {makeNuanceKey, makeBasicAuthHeader, noopLogger} = require('./utils'); -const { HTTP_TIMEOUT } = require('./config'); -const debug = require('debug')('jambonz:realtimedb-helpers'); - -async function getNuanceAccessToken(client, logger, clientId, secret, scope) { - logger = logger || noopLogger; - try { - const key = makeNuanceKey(clientId, secret, scope); - const access_token = await client.get(key); - if (access_token) return {access_token, servedFromCache: true}; - - /* access token not found in cache, so fetch it from Nuance */ - const payload = { - grant_type: 'client_credentials', - scope - }; - const auth = makeBasicAuthHeader(clientId, secret); - const {statusCode, headers, body} = await pool.request({ - path: '/oauth2/token', - method: 'POST', - headers: { - ...auth, - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: formurlencoded(payload), - timeout: HTTP_TIMEOUT, - followRedirects: false - }); - - if (200 !== statusCode) { - logger.debug({statusCode, headers, body: body.text()}, 'error fetching access token from Nuance'); - const err = new Error(); - err.statusCode = statusCode; - throw err; - } - const json = await body.json(); - await client.set(key, json.access_token, 'EX', json.expires_in - 30); - return {...json, servedFromCache: false}; - } catch (err) { - debug(err, `getNuanceAccessToken: Error retrieving Nuance access token for client_id ${clientId}`); - logger.error(err, `getNuanceAccessToken: Error retrieving Nuance access token for client_id ${clientId}`); - throw err; - } -} - -module.exports = getNuanceAccessToken; diff --git a/lib/get-tts-voices.js b/lib/get-tts-voices.js index afce9f2..ff363bd 100644 --- a/lib/get-tts-voices.js +++ b/lib/get-tts-voices.js @@ -1,74 +1,8 @@ const assert = require('assert'); -const {noopLogger, createNuanceClient, createKryptonClient} = require('./utils'); -const getNuanceAccessToken = require('./get-nuance-access-token'); -const getVerbioAccessToken = require('./get-verbio-token'); -const {GetVoicesRequest, Voice} = require('../stubs/nuance/synthesizer_pb'); +const {noopLogger} = require('./utils'); const ttsGoogle = require('@google-cloud/text-to-speech'); const { PollyClient, DescribeVoicesCommand } = require('@aws-sdk/client-polly'); const getAwsAuthToken = require('./get-aws-sts-token'); -const {Pool} = require('undici'); -const { HTTP_TIMEOUT } = require('./config'); -const verbioVoicePool = new Pool('https://us.rest.speechcenter.verbio.com'); - -const getNuanceVoices = async(client, logger, credentials) => { - const {client_id: clientId, secret: secret, nuance_tts_uri} = credentials; - - return new Promise(async(resolve, reject) => { - /* get a nuance access token */ - let token, nuanceClient; - try { - if (nuance_tts_uri) { - nuanceClient = await createKryptonClient(nuance_tts_uri); - } - else { - const access_token = await getNuanceAccessToken(client, logger, clientId, secret, 'tts'); - token = access_token.access_token; - nuanceClient = await createNuanceClient(token); - } - } catch (err) { - logger.error({err}, 'getTtsVoices: error retrieving access token'); - return reject(err); - } - /* retrieve all voices */ - const v = new Voice(); - const request = new GetVoicesRequest(); - request.setVoice(v); - - nuanceClient.getVoices(request, (err, response) => { - if (err) { - logger.error({err, clientId, secret, token}, 'getTtsVoices: error retrieving voices'); - return reject(err); - } - - /* return all the voices that are not restricted and eliminate duplicates */ - const voices = response.getVoicesList() - .map((v) => { - return { - language: v.getLanguage(), - name: v.getName(), - model: v.getModel(), - gender: v.getGender() === 1 ? 'male' : 'female', - restricted: v.getRestricted() - }; - }); - const v = voices - .filter((v) => v.restricted === false) - .map((v) => { - delete v.restricted; - return v; - }) - .sort((a, b) => { - if (a.language < b.language) return -1; - if (a.language > b.language) return 1; - if (a.name < b.name) return -1; - return 1; - }); - const arr = [...new Set(v.map((v) => JSON.stringify(v)))] - .map((v) => JSON.parse(v)); - resolve(arr); - }); - }); -}; const getGoogleVoices = async(_client, logger, credentials) => { const client = new ttsGoogle.TextToSpeechClient({credentials}); @@ -109,26 +43,6 @@ const getAwsVoices = async(_client, createHash, retrieveHash, logger, credential } }; -const getVerbioVoices = async(client, logger, credentials) => { - try { - const access_token = await getVerbioAccessToken(client, logger, credentials); - const { body} = await verbioVoicePool.request({ - path: '/api/v1/voices', - method: 'GET', - headers: { - 'Authorization': `Bearer ${access_token.access_token}`, - 'User-Agent': 'jambonz' - }, - timeout: HTTP_TIMEOUT, - followRedirects: false - }); - return await body.json(); - } catch (err) { - logger.info({err}, 'getVerbioVoices - failed to list voices for Verbio'); - throw err; - } -}; - /** * Synthesize speech to an mp3 file, and also cache the generated speech * in redis (base64 format) for 24 hours so as to avoid unnecessarily paying @@ -148,19 +62,15 @@ const getVerbioVoices = async(client, logger, credentials) => { async function getTtsVoices(client, createHash, retrieveHash, logger, {vendor, credentials}) { logger = logger || noopLogger; - assert.ok(['nuance', 'google', 'aws', 'polly', 'verbio'].includes(vendor), + assert.ok(['google', 'aws', 'polly'].includes(vendor), `getTtsVoices not supported for vendor ${vendor}`); switch (vendor) { - case 'nuance': - return getNuanceVoices(client, logger, credentials); case 'google': return getGoogleVoices(client, logger, credentials); case 'aws': case 'polly': return getAwsVoices(client, createHash, retrieveHash, logger, credentials); - case 'verbio': - return getVerbioVoices(client, logger, credentials); default: break; } diff --git a/lib/get-verbio-token.js b/lib/get-verbio-token.js deleted file mode 100644 index 9445a2e..0000000 --- a/lib/get-verbio-token.js +++ /dev/null @@ -1,51 +0,0 @@ -const {Pool} = require('undici'); -const { noopLogger, makeVerbioKey } = require('./utils'); -const { HTTP_TIMEOUT } = require('./config'); -const pool = new Pool('https://auth.speechcenter.verbio.com:444'); -const debug = require('debug')('jambonz:realtimedb-helpers'); - -async function getVerbioAccessToken(client, logger, credentials) { - logger = logger || noopLogger; - const { client_id, client_secret } = credentials; - try { - const key = makeVerbioKey(client_id); - const access_token = await client.get(key); - if (access_token) { - return {access_token, servedFromCache: true}; - } - - const payload = { - client_id, - client_secret - }; - - const {statusCode, headers, body} = await pool.request({ - path: '/api/v1/token', - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'User-Agent': 'jambonz' - }, - body: JSON.stringify(payload), - timeout: HTTP_TIMEOUT, - followRedirects: false - }); - - if (200 !== statusCode) { - logger.debug({statusCode, headers, body: await body.text()}, 'error fetching access token from Verbio'); - const err = new Error(); - err.statusCode = statusCode; - throw err; - } - const json = await body.json(); - const expiry = Math.floor(json.expiration_time - Date.now() / 1000 - 30); - await client.set(key, json.access_token, 'EX', expiry); - return {...json, servedFromCache: false}; - } catch (err) { - debug(err, `getVerbioAccessToken: Error retrieving Verbio access token for client_id ${client_id}`); - logger.error(err, `getVerbioAccessToken: Error retrieving Verbio access token for client_id ${client_id}`); - throw err; - } -} - -module.exports = getVerbioAccessToken; diff --git a/lib/synth-audio.js b/lib/synth-audio.js index b4782c9..e97ce7c 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -16,26 +16,10 @@ const { } = sdk; const { makeSynthKey, - createNuanceClient, - createKryptonClient, createRivaClient, noopLogger, - makeFilePath, - makePlayhtKey + makeFilePath } = require('./utils'); -const getNuanceAccessToken = require('./get-nuance-access-token'); -const getVerbioAccessToken = require('./get-verbio-token'); -const { - SynthesisRequest, - Voice, - AudioFormat, - AudioParameters, - PCM, - Input, - Text, - SSML, - EventParameters -} = require('../stubs/nuance/synthesizer_pb'); const {SynthesizeSpeechRequest} = require('../stubs/riva/proto/riva_tts_pb'); const {AudioEncoding} = require('../stubs/riva/proto/riva_audio_pb'); const debug = require('debug')('jambonz:realtimedb-helpers'); @@ -95,10 +79,10 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc let rtt; logger = logger || noopLogger; - assert.ok(['google', 'aws', 'polly', 'microsoft', 'wellsaid', 'nuance', 'nvidia', 'elevenlabs', - 'whisper', 'deepgram', 'playht', 'rimelabs', 'verbio', 'cartesia', 'inworld', 'resemble'].includes(vendor) || + assert.ok(['google', 'aws', 'polly', 'microsoft', 'wellsaid', 'nvidia', 'elevenlabs', + 'whisper', 'deepgram', 'rimelabs', 'cartesia', 'inworld', 'resemble'].includes(vendor) || vendor.startsWith('custom'), - `synthAudio supported vendors are google, aws, microsoft, nuance, nvidia and wellsaid ..etc, not ${vendor}`); + `synthAudio supported vendors are google, aws, microsoft, nvidia and wellsaid ..etc, not ${vendor}`); if ('google' === vendor) { assert.ok(language, 'synthAudio requires language when google is used'); } @@ -109,13 +93,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc assert.ok(language || deploymentId, 'synthAudio requires language when microsoft is used'); assert.ok(voice || deploymentId, 'synthAudio requires voice when microsoft is used'); } - else if ('nuance' === vendor) { - assert.ok(voice, 'synthAudio requires voice when nuance is used'); - if (!credentials.nuance_tts_uri) { - assert.ok(credentials.client_id, 'synthAudio requires client_id in credentials when nuance is used'); - assert.ok(credentials.secret, 'synthAudio requires client_id in credentials when nuance is used'); - } - } else if ('nvidia' === vendor) { assert.ok(voice, 'synthAudio requires voice when nvidia is used'); assert.ok(language, 'synthAudio requires language when nvidia is used'); @@ -129,11 +106,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc assert.ok(voice, 'synthAudio requires voice when elevenlabs is used'); assert.ok(credentials.api_key, 'synthAudio requires api_key when elevenlabs is used'); assert.ok(credentials.model_id, 'synthAudio requires model_id when elevenlabs is used'); - } else if ('playht' === vendor) { - assert.ok(voice, 'synthAudio requires voice when playht is used'); - assert.ok(credentials.api_key, 'synthAudio requires api_key when playht is used'); - assert.ok(credentials.user_id, 'synthAudio requires user_id when playht is used'); - assert.ok(credentials.voice_engine, 'synthAudio requires voice_engine when playht is used'); } else if ('inworld' === vendor) { assert.ok(voice, 'synthAudio requires voice when inworld is used'); assert.ok(credentials.api_key, 'synthAudio requires api_key when inworld is used'); @@ -148,10 +120,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc assert.ok(credentials.api_key, 'synthAudio requires api_key when whisper is used'); } else if (vendor.startsWith('custom')) { assert.ok(credentials.custom_tts_url, `synthAudio requires custom_tts_url in credentials when ${vendor} is used`); - } else if ('verbio' === vendor) { - assert.ok(voice, 'synthAudio requires voice when verbio is used'); - assert.ok(credentials.client_id, 'synthAudio requires client_id when verbio is used'); - assert.ok(credentials.client_secret, 'synthAudio requires client_secret when verbio is used'); } else if ('deepgram' === vendor) { if (!credentials.deepgram_tts_uri) { assert.ok(credentials.api_key, 'synthAudio requires api_key when deepgram is used'); @@ -216,10 +184,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc audioData = await synthMicrosoft(logger, {credentials, stats, language, voice, key, text, deploymentId, renderForCaching, disableTtsStreaming, disableTtsCache}); break; - case 'nuance': - model = model || 'enhanced'; - audioData = await synthNuance(client, logger, {credentials, stats, voice, model, key, text}); - break; case 'nvidia': audioData = await synthNvidia(client, logger, {credentials, stats, language, voice, model, key, text, renderForCaching, disableTtsStreaming, disableTtsCache}); @@ -232,11 +196,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc credentials, options, stats, language, voice, key, text, renderForCaching, disableTtsStreaming, disableTtsCache}); break; - case 'playht': - audioData = await synthPlayHT(client, logger, { - credentials, options, stats, language, voice, key, text, renderForCaching, disableTtsStreaming, - disableTtsCache}); - break; case 'cartesia': audioData = await synthCartesia(logger, { credentials, options, stats, language, voice, key, text, renderForCaching, disableTtsStreaming, @@ -257,11 +216,6 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc credentials, stats, voice, key, text, instructions, renderForCaching, disableTtsStreaming, disableTtsCache}); break; - case 'verbio': - audioData = await synthVerbio(client, logger, { - credentials, stats, voice, key, text, renderForCaching, disableTtsStreaming, disableTtsCache}); - if (audioData?.filePath) return audioData; - break; case 'deepgram': audioData = await synthDeepgram(logger, {credentials, stats, model, key, text, renderForCaching, disableTtsStreaming, disableTtsCache}); @@ -725,70 +679,6 @@ const synthWellSaid = async(logger, {credentials, stats, language, voice, gender } }; -const synthNuance = async(client, logger, {credentials, stats, voice, model, text}) => { - let nuanceClient; - const {client_id, secret, nuance_tts_uri} = credentials; - if (nuance_tts_uri) { - nuanceClient = await createKryptonClient(nuance_tts_uri); - } - else { - /* get a nuance access token */ - const {access_token} = await getNuanceAccessToken(client, logger, client_id, secret, 'tts'); - nuanceClient = await createNuanceClient(access_token); - } - - const v = new Voice(); - const p = new AudioParameters(); - const f = new AudioFormat(); - const pcm = new PCM(); - const params = new EventParameters(); - const request = new SynthesisRequest(); - const input = new Input(); - - if (text.startsWith(' { - nuanceClient.unarySynthesize(request, (err, response) => { - if (err) { - console.error(err); - return reject(err); - } - const status = response.getStatus(); - const code = status.getCode(); - if (code !== 200) { - const message = status.getMessage(); - const details = status.getDetails(); - return reject({code, message, details}); - } - resolve({ - audioContent: Buffer.from(response.getAudio()), - extension: 'r8', - sampleRate - }); - }); - }); -}; - const synthNvidia = async(client, logger, { credentials, stats, language, voice, model, key, text, renderForCaching, disableTtsStreaming, disableTtsCache }) => { @@ -954,101 +844,6 @@ const synthElevenlabs = async(logger, { } }; -const synthPlayHT = async(client, logger, { - credentials, options, stats, voice, language, key, text, renderForCaching, disableTtsStreaming, disableTtsCache -}) => { - const {api_key, user_id, voice_engine, playht_tts_uri, options: credOpts} = credentials; - const opts = !!options && Object.keys(options).length !== 0 ? options : JSON.parse(credOpts || '{}'); - - let synthesizeUrl = playht_tts_uri ? `${playht_tts_uri}/api/v2/tts/stream` : 'https://api.play.ht/api/v2/tts/stream'; - // If model is play3.0, the synthesizeUrl is got from authentication endpoint - if (voice_engine === 'Play3.0') { - try { - const post = bent('https://api.play.ht', 'POST', 'json', 201, { - 'AUTHORIZATION': api_key, - 'X-USER-ID': user_id, - 'Accept': 'application/json' - }); - const key = makePlayhtKey(api_key); - const url = await client.get(key); - if (!url) { - const {inference_address, expires_at_ms} = await post('/api/v3/auth'); - synthesizeUrl = inference_address; - const expiry = Math.floor((expires_at_ms - Date.now()) / 1000 - 30); - await client.set(key, inference_address, 'EX', expiry); - } else { - // Use cached URL - synthesizeUrl = url; - } - } catch (err) { - logger.info({err}, 'synth PlayHT returned error for authentication version 3.0'); - stats.increment('tts.count', ['vendor:playht', 'accepted:no']); - throw err; - } - } - - /* default to using the streaming interface, unless disabled by env var OR we want just a cache file */ - if (!JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching && !disableTtsStreaming) { - let params = '{'; - params += `api_key=${api_key}`; - params += `,playback_id=${key}`; - params += `,user_id=${user_id}`; - params += ',vendor=playht'; - params += `,voice=${voice}`; - params += `,voice_engine=${voice_engine}`; - params += `,synthesize_url=${synthesizeUrl}`; - params += `,write_cache_file=${disableTtsCache ? 0 : 1}`; - params += `,language=${language}`; - if (opts.quality) params += `,quality=${opts.quality}`; - if (opts.speed) params += `,speed=${opts.speed}`; - if (opts.seed) params += `,style=${opts.seed}`; - if (opts.temperature) params += `,temperature=${opts.temperature}`; - if (opts.emotion) params += `,emotion=${opts.emotion}`; - if (opts.voice_guidance) params += `,voice_guidance=${opts.voice_guidance}`; - if (opts.style_guidance) params += `,style_guidance=${opts.style_guidance}`; - if (opts.text_guidance) params += `,text_guidance=${opts.text_guidance}`; - if (opts.top_p) params += `,top_p=${opts.top_p}`; - if (opts.repetition_penalty) params += `,repetition_penalty=${opts.repetition_penalty}`; - params += '}'; - - return { - filePath: `say:${params}${text.replace(/\n/g, ' ').replace(/\r/g, ' ')}`, - servedFromCache: false, - rtt: 0 - }; - } - - try { - const post = bent('POST', 'buffer', { - ...(voice_engine !== 'Play3.0' && { - 'AUTHORIZATION': api_key, - 'X-USER-ID': user_id, - }), - 'Accept': 'audio/mpeg', - 'Content-Type': 'application/json' - }); - - const audioContent = await post(synthesizeUrl, { - text, - ...(voice_engine === 'Play3.0' && { language }), - voice, - voice_engine, - output_format: 'mp3', - sample_rate: 8000, - ...opts - }); - return { - audioContent, - extension: 'mp3', - sampleRate: 8000 - }; - } catch (err) { - logger.info({err}, 'synth PlayHT returned error'); - stats.increment('tts.count', ['vendor:playht', 'accepted:no']); - throw err; - } -}; - const synthInworld = async(logger, { credentials, options, stats, voice, key, text, renderForCaching, disableTtsStreaming, disableTtsCache }) => { @@ -1174,54 +969,6 @@ const synthRimelabs = async(logger, { throw err; } }; -const synthVerbio = async(client, logger, { - credentials, stats, voice, key, text, renderForCaching, disableTtsStreaming, disableTtsCache -}) => { - //https://doc.speechcenter.verbio.com/#tag/Text-To-Speech-REST-API - if (text.length > 2000) { - throw new Error('Verbio cannot synthesize for the text length larger than 2000 characters'); - } - const token = await getVerbioAccessToken(client, logger, credentials); - if (!process.env.JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching && !disableTtsStreaming) { - let params = '{'; - params += `access_token=${token.access_token}`; - params += `,playback_id=${key}`; - params += ',vendor=verbio'; - params += `,voice=${voice}`; - params += `,write_cache_file=${disableTtsCache ? 0 : 1}`; - params += '}'; - - return { - filePath: `say:${params}${text.replace(/\n/g, ' ')}`, - servedFromCache: false, - rtt: 0 - }; - } - - try { - const post = bent('https://us.rest.speechcenter.verbio.com', 'POST', 'buffer', { - 'Authorization': `Bearer ${token.access_token}`, - 'User-Agent': 'jambonz', - 'Content-Type': 'application/json' - }); - const audioContent = await post('/api/v1/synthesize', { - voice_id: voice, - output_sample_rate: '8k', - output_encoding: 'pcm16', - text - }); - return { - audioContent, - extension: 'r8', - sampleRate: 8000 - }; - } catch (err) { - logger.info({err}, 'synth Verbio returned error'); - stats.increment('tts.count', ['vendor:verbio', 'accepted:no']); - throw err; - } -}; - const synthWhisper = async(logger, {credentials, stats, voice, key, text, instructions, renderForCaching, disableTtsStreaming, disableTtsCache}) => { const {api_key, model_id, baseURL, timeout, speed} = credentials; diff --git a/lib/utils.js b/lib/utils.js index 54eaeb6..1d64f08 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,20 +1,7 @@ const crypto = require('crypto'); -const {SynthesizerClient} = require('../stubs/nuance/synthesizer_grpc_pb'); const {RivaSpeechSynthesisClient} = require('../stubs/riva/proto/riva_tts_grpc_pb'); -const {Pool} = require('undici'); -const pool = new Pool('https://auth.crt.nuance.com'); -const NUANCE_AUTH_ENDPOINT = 'tts.api.nuance.com:443'; const grpc = require('@grpc/grpc-js'); -const formurlencoded = require('form-urlencoded'); -const { TMP_FOLDER, HTTP_TIMEOUT } = require('./config'); - -const debug = require('debug')('jambonz:realtimedb-helpers'); -/** - * Future TODO: cache recently used connections to providers - * to avoid connection overhead during a call. - * Will need to periodically age them out to avoid memory leaks. - */ -//const nuanceClientMap = new Map(); +const { TMP_FOLDER } = require('./config'); function makeSynthKey({ account_sid = '', @@ -45,90 +32,12 @@ const noopLogger = { error: () => {} }; -const toBase64 = (str) => Buffer.from(str || '', 'utf8').toString('base64'); - -function makeBasicAuthHeader(username, password) { - if (!username || !password) return {}; - const creds = `${encodeURIComponent(username)}:${password || ''}`; - const header = `Basic ${toBase64(creds)}`; - return {Authorization: header}; -} - function makeAwsKey(awsAccessKeyId) { const hash = crypto.createHash('sha1'); hash.update(awsAccessKeyId); return `aws:${hash.digest('hex')}`; } -function makePlayhtKey(apiKey) { - const hash = crypto.createHash('sha1'); - hash.update(apiKey); - return `playht:${hash.digest('hex')}`; -} -function makeVerbioKey(client_id) { - const hash = crypto.createHash('sha1'); - hash.update(client_id); - return `verbio:${hash.digest('hex')}`; -} - -function makeNuanceKey(clientId, secret, scope) { - const hash = crypto.createHash('sha1'); - hash.update(`${clientId}:${secret}:${scope}`); - return `nuance:${hash.digest('hex')}`; -} - -const getNuanceAccessToken = async(clientId, secret, scope = 'asr tts') => { - const payload = { - grant_type: 'client_credentials', - scope - }; - const auth = makeBasicAuthHeader(clientId, secret); - const {statusCode, headers, body} = await pool.request({ - path: '/oauth2/token', - method: 'POST', - headers: { - ...auth, - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: formurlencoded(payload), - timeout: HTTP_TIMEOUT, - followRedirects: false - }); - - if (200 !== statusCode) { - debug({statusCode, headers, body: body.text()}, 'error fetching access token from Nuance'); - const err = new Error(); - err.statusCode = statusCode; - throw err; - } - const json = await body.json(); - return json.access_token; -}; - -const createKryptonClient = async(uri) => { - const client = new SynthesizerClient(uri, grpc.credentials.createInsecure()); - return client; -}; - -const createNuanceClient = async(access_token) => { - - //if (nuanceClientMap.has(access_token)) return nuanceClientMap.get(access_token); - - const generateMetadata = (params, callback) => { - var metadata = new grpc.Metadata(); - metadata.add('authorization', `Bearer ${access_token}`); - callback(null, metadata); - }; - - const sslCreds = grpc.credentials.createSsl(); - const authCreds = grpc.credentials.createFromMetadataGenerator(generateMetadata); - const combined_creds = grpc.credentials.combineChannelCredentials(sslCreds, authCreds); - const client = new SynthesizerClient(NUANCE_AUTH_ENDPOINT, combined_creds); - - //if (process.env.NUANCE_CACHE_TTS_CONNECTIONS) nuanceClientMap.set(access_token, client); - return client; -}; - const createRivaClient = async(rivaUri) => { const client = new RivaSpeechSynthesisClient(rivaUri, grpc.credentials.createInsecure()); return client; @@ -136,17 +45,8 @@ const createRivaClient = async(rivaUri) => { module.exports = { makeSynthKey, - makeNuanceKey, - - makePlayhtKey, makeAwsKey, - makeVerbioKey, - getNuanceAccessToken, - createNuanceClient, - createKryptonClient, createRivaClient, - makeBasicAuthHeader, - NUANCE_AUTH_ENDPOINT, noopLogger, makeFilePath }; diff --git a/package-lock.json b/package-lock.json index 1b2676d..2e84f94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jambonz/speech-utils", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@jambonz/speech-utils", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "dependencies": { "23": "^0.0.0", @@ -18,7 +18,6 @@ "@jambonz/realtimedb-helpers": "^0.8.7", "bent": "^7.3.12", "debug": "^4.3.4", - "form-urlencoded": "^6.1.4", "google-protobuf": "^3.21.2", "microsoft-cognitiveservices-speech-sdk": "1.38.0", "openai": "^4.98.0", @@ -3747,11 +3746,6 @@ "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" }, - "node_modules/form-urlencoded": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/form-urlencoded/-/form-urlencoded-6.1.4.tgz", - "integrity": "sha512-vDFWgogZ04th20oxQtDSF8CDjrBgAPtP1V+W3kZni5IZqyasDDVNqCQGOXfYlmOJj0zpROgiAtPJXCmidtxDTQ==" - }, "node_modules/formdata-node": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", @@ -10064,11 +10058,6 @@ "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" }, - "form-urlencoded": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/form-urlencoded/-/form-urlencoded-6.1.4.tgz", - "integrity": "sha512-vDFWgogZ04th20oxQtDSF8CDjrBgAPtP1V+W3kZni5IZqyasDDVNqCQGOXfYlmOJj0zpROgiAtPJXCmidtxDTQ==" - }, "formdata-node": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", diff --git a/package.json b/package.json index 94e8360..c50b804 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "coverage": "nyc --reporter html --report-dir ./coverage npm run test", "jslint": "eslint index.js lib", "jslint:fix": "npm run jslint --fix", - "build": "./build_stubs.sh", "prepare": "husky" }, "repository": { @@ -35,7 +34,6 @@ "@jambonz/realtimedb-helpers": "^0.8.7", "bent": "^7.3.12", "debug": "^4.3.4", - "form-urlencoded": "^6.1.4", "google-protobuf": "^3.21.2", "microsoft-cognitiveservices-speech-sdk": "1.38.0", "openai": "^4.98.0", diff --git a/protos/nuance/synthesizer.proto b/protos/nuance/synthesizer.proto deleted file mode 100644 index 2738359..0000000 --- a/protos/nuance/synthesizer.proto +++ /dev/null @@ -1,332 +0,0 @@ -syntax = "proto3"; - -package nuance.tts.v1; - -/* -The Synthesizer service offers these functionalities: -* - GetVoices: Queries the list of available voices, with filters to reduce the search space. -* - Synthesize: Synthesizes audio from input text and parameters, and returns an audio stream. -* - UnarySynthesize: Synthesizes audio from input text and parameters, and returns a single audio response. -*/ -service Synthesizer { - rpc GetVoices(GetVoicesRequest) returns (GetVoicesResponse) {} - rpc Synthesize(SynthesisRequest) returns (stream SynthesisResponse) {} - rpc UnarySynthesize(SynthesisRequest) returns (UnarySynthesisResponse) {} -} - -/* -Input message for [Synthesizer](#synthesizer) - GetVoices, to query voices available to the client. -*/ -message GetVoicesRequest { - Voice voice = 1; // Optionally filter the voices to retrieve, e.g. set language to en-US to return only American English voices. -} - -/* -Output message for [Synthesizer](#synthesizer) - GetVoices. Includes a list of voices that matched the input criteria, if any. -*/ -message GetVoicesResponse { - repeated Voice voices = 1; // Repeated. Voices and characteristics returned. -} - -/* -Input message for [Synthesizer](#synthesizer) - Synthesize. Specifies input text, audio parameters, and events to subscribe to, in exchange for synthesized audio. -*/ -message SynthesisRequest { - Voice voice = 1; // The voice to use for audio synthesis. Mandatory. - AudioParameters audio_params = 2; // Output audio parameters, such as encoding and volume. - Input input = 3; // Input text to synthesize, tuning data, etc. Mandatory. - EventParameters event_params = 4; // Markers and other info to include in server events returned during synthesis. - map client_data = 5; // Repeated. Client-supplied key-value pairs to inject into the call log. - string user_id = 6; // Identifies a particular user within an application. -} - -/* -Input or output message for voices. When sent as input: -* - In [GetVoicesRequest](#getvoicesrequest), it filters the list of available voices. -* - In [SynthesisRequest](#synthesisrequest), it specifies the voice to use for synthesis. - -When received as output in [GetVoicesResponse](#getvoicesresponse), it returns the list of available voices. -*/ -message Voice { - string name = 1; // The voice's name, e.g. 'Evan'. Mandatory for SynthesisRequest. - string model = 2; // The voice's quality model, e.g. 'enhanced' or 'standard'. Mandatory for SynthesisRequest. - string language = 3; // IETF language code, e.g. 'en-US'. Used only for GetVoicesRequest and GetVoicesResponse, to search for voices with a certain mother tongue. Ignored otherwise. - EnumAgeGroup age_group = 4; // Used only for GetVoicesRequest and GetVoicesResponse, to search for adult or child voices. Ignored otherwise. - EnumGender gender = 5; // Used only for GetVoicesRequest and GetVoicesResponse, to search for voices with a certain gender. Ignored otherwise. - uint32 sample_rate_hz = 6; // Used only for GetVoicesRequest and GetVoicesResponse, to search for a certain native sample rate. Ignored otherwise. - string language_tlw = 7; // Used only for GetVoicesRequest and GetVoicesResponse. Three-letter language code (e.g. 'enu' for American English), for configuring language identification in [Input](#input). - bool restricted = 8; // Used only in GetVoicesResponse, to identify restricted voices. These are custom voices available only to specific customers. Ignored otherwise. - string version = 9; // Used only in GetVoicesResponse, to return the voice's version. Ignored otherwise. -} - -/* -Input or output field specifying whether the voice uses its adult or child version, if available. Included in [Voice](#voice). -*/ -enum EnumAgeGroup { - ADULT = 0; // Adult voice. Default for GetVoicesRequest. - CHILD = 1; // Child voice. -} - -/* -Input or output field, specifying gender for voices that support multiple genders. Included in [Voice](#voice). -*/ -enum EnumGender { - ANY = 0; // Any gender voice. Default for GetVoicesRequest. - MALE = 1; // Male voice. - FEMALE = 2; // Female voice. - NEUTRAL = 3; // Neutral gender voice. -} - -/* -Input message for audio-related parameters during synthesis, including encoding, volume, and audio length. Included in [SynthesisRequest](#synthesisrequest). -*/ -message AudioParameters { - AudioFormat audio_format = 1; // Audio encoding. Default PCM 22.5kHz. - uint32 volume_percentage = 2; // Volume amplitude, from 0 to 100. Default 80. - float speaking_rate_factor = 3; // Speaking rate, from 0 to 2.0. Default 1.0. - uint32 audio_chunk_duration_ms = 4; // Maximum duration, in ms, of an audio chunk delivered to the client, from 1 to 60000. Default is 20000 (20 seconds). When this parameter is large enough (for example, 20 or 30 seconds), each audio chunk contains an audible segment surrounded by silence. - uint32 target_audio_length_ms = 5; // Maximum duration, in ms, of synthesized audio. When greater than 0, the server stops ongoing synthesis at the first sentence end, or silence, closest to the value. - bool disable_early_emission = 6; // By default, audio segments are emitted as soon as possible, even if they are not audible. This behavior may be disabled. -} - -/* -Input message for audio encoding of synthesized text. Included in [AudioParameters](#audioparameters). -*/ -message AudioFormat { - oneof audio_format { - PCM pcm = 1; // Signed 16-bit little endian PCM. - ALaw alaw = 2; // G.711 A-law, 8kHz. - ULaw ulaw = 3; // G.711 Mu-law, 8kHz. - OggOpus ogg_opus = 4; // Ogg Opus, 8kHz, 16kHz or 24kHz. - Opus opus = 5; // Opus, 8kHz, 16kHZ or 24 kHz. The audio will be sent one Opus packet at a time. - } -} - -/* -Input message defining PCM sample rate. Included in [Audioformat](#audioformat). -*/ -message PCM { - uint32 sample_rate_hz = 1; // Output sample rate: 8000, 16000, 22050 (default), 24000. -} - -/* -Input message defining A-law audio format. G.711 audio formats are set to 8kHz. Included in [Audioformat](#audioformat). -*/ -message ALaw {} - -/* -Input message defining Mu-law audio format. G.711 audio formats are set to 8kHz. Included in [Audioformat](#audioformat). -*/ -message ULaw {} - -/* -Input message defining Opus output rate. Included in [Audioformat](#audioformat). -*/ -message Opus { - uint32 sample_rate_hz = 1; // Output sample rate. Supported values: 8000, 16000, 24000 Hz. - uint32 bit_rate_bps = 2; // Valid range is 500 to 256000 bps. Default 28000 bps. - float max_frame_duration_ms = 3; // Opus frame size, in ms: 2.5, 5, 10, 20, 40, 60. Default 20. - uint32 complexity = 4; // Computational complexity. A complexity of 0 means the codec default. - EnumVariableBitrate vbr = 5; // Variable bitrate. On by default. -} - -/* -Input message defining Ogg Opus output rate. Included in [Audioformat](#audioformat). -*/ -message OggOpus { - uint32 sample_rate_hz = 1; // Output sample rate. Supported values: 8000, 16000, 24000 Hz. - uint32 bit_rate_bps = 2; // Valid range is 500 to 256000 bps. Default 28000 bps. - float max_frame_duration_ms = 3; // Opus frame size, in ms: 2.5, 5, 10, 20, 40, 60. Default 20. - uint32 complexity = 4; // Computational complexity. A complexity of 0 means the codec default. - EnumVariableBitrate vbr = 5; // Variable bitrate. On by default. -} - -/* -Settings for variable bitrate. Included in [OggOpus](#oggopus). Turned on by default. -*/ -enum EnumVariableBitrate { - VARIABLE_BITRATE_ON = 0; // Use variable bitrate. Default. - VARIABLE_BITRATE_OFF = 1; // Do not use variable bitrate. - VARIABLE_BITRATE_CONSTRAINED = 2; // Use constrained variable bitrate. -} - -/* -Input message containing text to synthesize and synthesis parameters, including tuning data, etc. Included in [SynthesisRequest](#synthesisrequest). The type of input may be: -* - Plain text. -* - An SSML document. -* - An alternating sequence of plain text and Nuance control codes. -*/ -message Input { - oneof input_data { - Text text = 1; // Text input. - SSML ssml = 2; // SSML input. - TokenizedSequence tokenized_sequence = 3; // Sequence of text and Nuance control codes. - } - repeated SynthesisResource resources = 4; // Repeated. Synthesis resources (user dictionaries, rulesets, etc.) to tune synthesized audio. - LanguageIdentificationParameters lid_params = 5; // LID parameters. - DownloadParameters download_params = 6; // Remote file download parameters. -} - -/* -Input message for synthesizing plain text. The encoding must be in UTF-8. -*/ -message Text { - oneof text_data { - string text = 1; // Plain input text in UTF-8 encoding. - string uri = 2; // Remote URI to the plain input text. Disabled for Nuance-hosted TTS. - } -} - -/* -Input message for synthesizing an SSML document. -*/ -message SSML { - oneof ssml_data { - string text = 1; // SSML input text. - string uri = 2; // Remote URI to the SSML input text. Disabled for Nuance-hosted TTS. - } - EnumSSMLValidationMode ssml_validation_mode = 3; // SSML validation mode. Default STRICT. -} - -/* -Input message for synthesizing a sequence of plain text and Nuance control codes. -*/ -message TokenizedSequence { - repeated Token tokens = 1; -} - -/* -The unit when using TokenizedSequence for input. Each token can either be plain text or a Nuance control code. -*/ -message Token { - oneof token_data { - string text = 1; // Plain input text. - ControlCode control_code = 2; // Nuance control code. - } -} - -/* -A Nuance control code allows the user to control how text is spoken, similarly to SSML. -*/ -message ControlCode { - string key = 1; // Name of the control code, e.g. "pause". - string value = 2; // Value of the control code. -} - -/* -Input message specifying the type of file to tune the synthesized output and its location or contents. Included in [Input](#input). -*/ -message SynthesisResource { - EnumResourceType type = 1; // Resource type, e.g. user dictionary, etc. Default USER_DICTIONARY. - oneof resource_data { - string uri = 2; // URI to the remote resource, or - bytes body = 3; // For EnumResourceType USER_DICTIONARY, the contents of the file. - } -} - -/* -The type of synthesis resource to tune the output. Included in [SynthesisResource](#synthesisresource). User dictionaries provide custom pronunciations, rulesets apply search-and-replace rules to input text and ActivePrompt databases help tune synthesized audio under certain conditions, using Nuance Vocalizer Studio. -*/ -enum EnumResourceType { - USER_DICTIONARY = 0; // User dictionary (application/edct-bin-dictionary). Default. - TEXT_USER_RULESET = 1; // Text user ruleset (application/x-vocalizer-rettt+text). - BINARY_USER_RULESET = 2; // Binary user ruleset (application/x-vocalizer-rettt+bin). - ACTIVEPROMPT_DB = 3; // ActivePrompt database (application/x-vocalizer/activeprompt-db). - ACTIVEPROMPT_DB_AUTO = 4; // ActivePrompt database with automatic insertion (application/x-vocalizer/activeprompt-db;mode=automatic). - SYSTEM_DICTIONARY = 5; // Nuance system dictionary (application/sdct-bin-dictionary). -} - -/* -SSML validation mode when using SSML input. Included in [Input](#input). Strict by default but can be relaxed. -*/ -enum EnumSSMLValidationMode { - STRICT = 0; // Strict SSL validation. Default. - WARN = 1; // Give warning only. - NONE = 2; // Do not validate. -} - -/* -Input message controlling the language identifier. Included in [Input](#input). The language identifier runs on input blocks labeled with the \lang=unknown\ control sequence or SSML xml:lang="unknown". The language identifier automatically restricts the matched languages to the installed voices. This limits the permissible languages, and also sets the order of precedence (first to last) when they have equal confidence scores. -*/ -message LanguageIdentificationParameters { - bool disable = 1; // Whether to disable language identification. Turned on by default. - repeated string languages = 2; // Repeated. List of three-letter language codes (e.g. enu, frc, spm) to restrict language identification results, in order of precedence. Use GetVoicesRequest - Voice - language_tlw to obtain the three-letter codes. Default blank. - bool always_use_highest_confidence = 3; // If enabled, language identification always chooses the language with the highest confidence score, even if the score is low. Default false, meaning use language with any confidence. -} - -/* -Input message containing parameters for remote file download, whether for input text (Input.uri) or a SynthesisResource (SynthesisResource.uri). Included in [Input](#input). -*/ -message DownloadParameters { - map headers = 1; // HTTP headers to include in outgoing requests. Only whitelisted headers will actually be sent. - bool refuse_cookies = 2; // Whether to disable cookies. By default, HTTP requests accept cookies. - oneof optional_download_parameter_request_timeout_ms { - uint32 request_timeout_ms = 3; // Request timeout in ms. Default (0) means server default, usually 30000 (30 seconds). - } -} - -/* -Input message that defines event subscription parameters. Included in [SynthesisRequest](#synthesisrequest). Events that are requested are sent throughout the SynthesisResponse stream, when generated. Marker events can send events as certain parts of the synthesized audio are reached, for example, at the end of a word, sentence, or user-defined bookmark. - -* Log events are produced throughout a synthesis request for events such as a voice loaded by the server or an audio chunk being ready to send. -*/ -message EventParameters { - bool send_sentence_marker_events = 1; // Sentence marker. Default: do not send. - bool send_word_marker_events = 2; // Word marker. Default: do not send. - bool send_phoneme_marker_events = 3; // Phoneme marker. Default: do not send. - bool send_bookmark_marker_events = 4; // Bookmark marker. Default: do not send. - bool send_paragraph_marker_events = 5; // Paragraph marker. Default: do not send. - bool send_visemes = 6; // Lipsync information. Default: do not send. - bool send_log_events = 7; // Whether to log events during synthesis. By default, logging is turned off. - bool suppress_input = 8; // Whether to omit input text and URIs from log events. By default, these items are included. -} - -/* -The [Synthesizer](#synthesizer) - Synthesize RPC call returns a stream of SynthesisResponse messages. The response contains one of: -* - A status response, indicating completion or failure of the request. This is received only once and signifies the end of a Synthesize call. -* - A list of events the client has requested. This can be received many times. See EventParameters for details. -* - An audio buffer. This may be received many times. -*/ -message SynthesisResponse { - oneof response { - Status status = 1; // A status response, indicating completion or failure of the request. - Events events = 2; // A list of events. See EventParameters for details. - bytes audio = 3; // The latest audio buffer. - } -} - -/* -The [Synthesizer](#synthesizer) - UnarySynthesize RPC call returns a single UnarySynthesisResponse message. It is similar to a SynthesisResponse message but includes all the information instead of a single type of response. The response contains: -* - A status response, indicating completion or failure of the request. -* - A list of events the client has requested. See EventParameters for details. -* - The complete audio buffer of the synthesized text. -*/ -message UnarySynthesisResponse { - Status status = 1; // A status response, indicating completion or failure of the request. - Events events = 2; // A list of events. See EventParameters for details. - bytes audio = 3; // Audio buffer of the synthesized text. -} - -/* -Output message containing a status response, indicating completion or failure of a SynthesisRequest. Included in [SynthesisResponse](#synthesisresponse) and [UnarySynthesisResponse](#unarysynthesisresponse). -*/ -message Status { - uint32 code = 1; // HTTP-style return code: 200, 4xx, or 5xx as appropriate. - string message = 2; // Brief description of the status. - string details = 3; // Longer description if available. -} - -/* -Output message defining a container for a list of events. This container is needed because oneof does not allow repeated parameters in Protobuf. Included in [SynthesisResponse](#synthesisresponse) and [UnarySynthesisResponse](#unarysynthesisresponse). -*/ -message Events { - repeated Event events = 1; // Repeated. One or more events. -} - -/* -Output message defining an event message. Included in [Events](#events). See EventParameters for details. -*/ -message Event { - string name = 1; // Either "Markers" or the name of the event in the case of a Log Event. - map values = 2; // Repeated. Key-value data relevant to the current event. -} diff --git a/stubs/nuance/synthesizer_grpc_pb.js b/stubs/nuance/synthesizer_grpc_pb.js deleted file mode 100644 index de0b045..0000000 --- a/stubs/nuance/synthesizer_grpc_pb.js +++ /dev/null @@ -1,104 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var synthesizer_pb = require('./synthesizer_pb.js'); - -function serialize_nuance_tts_v1_GetVoicesRequest(arg) { - if (!(arg instanceof synthesizer_pb.GetVoicesRequest)) { - throw new Error('Expected argument of type nuance.tts.v1.GetVoicesRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nuance_tts_v1_GetVoicesRequest(buffer_arg) { - return synthesizer_pb.GetVoicesRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nuance_tts_v1_GetVoicesResponse(arg) { - if (!(arg instanceof synthesizer_pb.GetVoicesResponse)) { - throw new Error('Expected argument of type nuance.tts.v1.GetVoicesResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nuance_tts_v1_GetVoicesResponse(buffer_arg) { - return synthesizer_pb.GetVoicesResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nuance_tts_v1_SynthesisRequest(arg) { - if (!(arg instanceof synthesizer_pb.SynthesisRequest)) { - throw new Error('Expected argument of type nuance.tts.v1.SynthesisRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nuance_tts_v1_SynthesisRequest(buffer_arg) { - return synthesizer_pb.SynthesisRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nuance_tts_v1_SynthesisResponse(arg) { - if (!(arg instanceof synthesizer_pb.SynthesisResponse)) { - throw new Error('Expected argument of type nuance.tts.v1.SynthesisResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nuance_tts_v1_SynthesisResponse(buffer_arg) { - return synthesizer_pb.SynthesisResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nuance_tts_v1_UnarySynthesisResponse(arg) { - if (!(arg instanceof synthesizer_pb.UnarySynthesisResponse)) { - throw new Error('Expected argument of type nuance.tts.v1.UnarySynthesisResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nuance_tts_v1_UnarySynthesisResponse(buffer_arg) { - return synthesizer_pb.UnarySynthesisResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// -// The Synthesizer service offers these functionalities: -// - GetVoices: Queries the list of available voices, with filters to reduce the search space. -// - Synthesize: Synthesizes audio from input text and parameters, and returns an audio stream. -// - UnarySynthesize: Synthesizes audio from input text and parameters, and returns a single audio response. -var SynthesizerService = exports.SynthesizerService = { - getVoices: { - path: '/nuance.tts.v1.Synthesizer/GetVoices', - requestStream: false, - responseStream: false, - requestType: synthesizer_pb.GetVoicesRequest, - responseType: synthesizer_pb.GetVoicesResponse, - requestSerialize: serialize_nuance_tts_v1_GetVoicesRequest, - requestDeserialize: deserialize_nuance_tts_v1_GetVoicesRequest, - responseSerialize: serialize_nuance_tts_v1_GetVoicesResponse, - responseDeserialize: deserialize_nuance_tts_v1_GetVoicesResponse, - }, - synthesize: { - path: '/nuance.tts.v1.Synthesizer/Synthesize', - requestStream: false, - responseStream: true, - requestType: synthesizer_pb.SynthesisRequest, - responseType: synthesizer_pb.SynthesisResponse, - requestSerialize: serialize_nuance_tts_v1_SynthesisRequest, - requestDeserialize: deserialize_nuance_tts_v1_SynthesisRequest, - responseSerialize: serialize_nuance_tts_v1_SynthesisResponse, - responseDeserialize: deserialize_nuance_tts_v1_SynthesisResponse, - }, - unarySynthesize: { - path: '/nuance.tts.v1.Synthesizer/UnarySynthesize', - requestStream: false, - responseStream: false, - requestType: synthesizer_pb.SynthesisRequest, - responseType: synthesizer_pb.UnarySynthesisResponse, - requestSerialize: serialize_nuance_tts_v1_SynthesisRequest, - requestDeserialize: deserialize_nuance_tts_v1_SynthesisRequest, - responseSerialize: serialize_nuance_tts_v1_UnarySynthesisResponse, - responseDeserialize: deserialize_nuance_tts_v1_UnarySynthesisResponse, - }, -}; - -exports.SynthesizerClient = grpc.makeGenericClientConstructor(SynthesizerService); diff --git a/stubs/nuance/synthesizer_pb.js b/stubs/nuance/synthesizer_pb.js deleted file mode 100644 index 1351561..0000000 --- a/stubs/nuance/synthesizer_pb.js +++ /dev/null @@ -1,6815 +0,0 @@ -// source: synthesizer.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.nuance.tts.v1.ALaw', null, global); -goog.exportSymbol('proto.nuance.tts.v1.AudioFormat', null, global); -goog.exportSymbol('proto.nuance.tts.v1.AudioFormat.AudioFormatCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.AudioParameters', null, global); -goog.exportSymbol('proto.nuance.tts.v1.ControlCode', null, global); -goog.exportSymbol('proto.nuance.tts.v1.DownloadParameters', null, global); -goog.exportSymbol('proto.nuance.tts.v1.DownloadParameters.OptionalDownloadParameterRequestTimeoutMsCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EnumAgeGroup', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EnumGender', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EnumResourceType', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EnumSSMLValidationMode', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EnumVariableBitrate', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Event', null, global); -goog.exportSymbol('proto.nuance.tts.v1.EventParameters', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Events', null, global); -goog.exportSymbol('proto.nuance.tts.v1.GetVoicesRequest', null, global); -goog.exportSymbol('proto.nuance.tts.v1.GetVoicesResponse', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Input', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Input.InputDataCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.LanguageIdentificationParameters', null, global); -goog.exportSymbol('proto.nuance.tts.v1.OggOpus', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Opus', null, global); -goog.exportSymbol('proto.nuance.tts.v1.PCM', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SSML', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SSML.SsmlDataCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Status', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SynthesisRequest', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SynthesisResource', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SynthesisResource.ResourceDataCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SynthesisResponse', null, global); -goog.exportSymbol('proto.nuance.tts.v1.SynthesisResponse.ResponseCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Text', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Text.TextDataCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Token', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Token.TokenDataCase', null, global); -goog.exportSymbol('proto.nuance.tts.v1.TokenizedSequence', null, global); -goog.exportSymbol('proto.nuance.tts.v1.ULaw', null, global); -goog.exportSymbol('proto.nuance.tts.v1.UnarySynthesisResponse', null, global); -goog.exportSymbol('proto.nuance.tts.v1.Voice', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.GetVoicesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.GetVoicesRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.GetVoicesRequest.displayName = 'proto.nuance.tts.v1.GetVoicesRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.GetVoicesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nuance.tts.v1.GetVoicesResponse.repeatedFields_, null); -}; -goog.inherits(proto.nuance.tts.v1.GetVoicesResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.GetVoicesResponse.displayName = 'proto.nuance.tts.v1.GetVoicesResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.SynthesisRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.SynthesisRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.SynthesisRequest.displayName = 'proto.nuance.tts.v1.SynthesisRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Voice = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.Voice, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Voice.displayName = 'proto.nuance.tts.v1.Voice'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.AudioParameters = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.AudioParameters, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.AudioParameters.displayName = 'proto.nuance.tts.v1.AudioParameters'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.AudioFormat = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.AudioFormat.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.AudioFormat, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.AudioFormat.displayName = 'proto.nuance.tts.v1.AudioFormat'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.PCM = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.PCM, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.PCM.displayName = 'proto.nuance.tts.v1.PCM'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.ALaw = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.ALaw, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.ALaw.displayName = 'proto.nuance.tts.v1.ALaw'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.ULaw = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.ULaw, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.ULaw.displayName = 'proto.nuance.tts.v1.ULaw'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Opus = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.Opus, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Opus.displayName = 'proto.nuance.tts.v1.Opus'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.OggOpus = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.OggOpus, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.OggOpus.displayName = 'proto.nuance.tts.v1.OggOpus'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Input = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nuance.tts.v1.Input.repeatedFields_, proto.nuance.tts.v1.Input.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.Input, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Input.displayName = 'proto.nuance.tts.v1.Input'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Text = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.Text.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.Text, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Text.displayName = 'proto.nuance.tts.v1.Text'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.SSML = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.SSML.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.SSML, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.SSML.displayName = 'proto.nuance.tts.v1.SSML'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.TokenizedSequence = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nuance.tts.v1.TokenizedSequence.repeatedFields_, null); -}; -goog.inherits(proto.nuance.tts.v1.TokenizedSequence, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.TokenizedSequence.displayName = 'proto.nuance.tts.v1.TokenizedSequence'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Token = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.Token.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.Token, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Token.displayName = 'proto.nuance.tts.v1.Token'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.ControlCode = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.ControlCode, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.ControlCode.displayName = 'proto.nuance.tts.v1.ControlCode'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.SynthesisResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.SynthesisResource.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.SynthesisResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.SynthesisResource.displayName = 'proto.nuance.tts.v1.SynthesisResource'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.LanguageIdentificationParameters = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nuance.tts.v1.LanguageIdentificationParameters.repeatedFields_, null); -}; -goog.inherits(proto.nuance.tts.v1.LanguageIdentificationParameters, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.LanguageIdentificationParameters.displayName = 'proto.nuance.tts.v1.LanguageIdentificationParameters'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.DownloadParameters = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.DownloadParameters.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.DownloadParameters, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.DownloadParameters.displayName = 'proto.nuance.tts.v1.DownloadParameters'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.EventParameters = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.EventParameters, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.EventParameters.displayName = 'proto.nuance.tts.v1.EventParameters'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.SynthesisResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_); -}; -goog.inherits(proto.nuance.tts.v1.SynthesisResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.SynthesisResponse.displayName = 'proto.nuance.tts.v1.SynthesisResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.UnarySynthesisResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.UnarySynthesisResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.UnarySynthesisResponse.displayName = 'proto.nuance.tts.v1.UnarySynthesisResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Status = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.Status, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Status.displayName = 'proto.nuance.tts.v1.Status'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Events = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nuance.tts.v1.Events.repeatedFields_, null); -}; -goog.inherits(proto.nuance.tts.v1.Events, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Events.displayName = 'proto.nuance.tts.v1.Events'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.nuance.tts.v1.Event = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nuance.tts.v1.Event, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nuance.tts.v1.Event.displayName = 'proto.nuance.tts.v1.Event'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.GetVoicesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.GetVoicesRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.GetVoicesRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.GetVoicesRequest.toObject = function(includeInstance, msg) { - var f, obj = { - voice: (f = msg.getVoice()) && proto.nuance.tts.v1.Voice.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.GetVoicesRequest} - */ -proto.nuance.tts.v1.GetVoicesRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.GetVoicesRequest; - return proto.nuance.tts.v1.GetVoicesRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.GetVoicesRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.GetVoicesRequest} - */ -proto.nuance.tts.v1.GetVoicesRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Voice; - reader.readMessage(value,proto.nuance.tts.v1.Voice.deserializeBinaryFromReader); - msg.setVoice(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.GetVoicesRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.GetVoicesRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.GetVoicesRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.GetVoicesRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVoice(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.Voice.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Voice voice = 1; - * @return {?proto.nuance.tts.v1.Voice} - */ -proto.nuance.tts.v1.GetVoicesRequest.prototype.getVoice = function() { - return /** @type{?proto.nuance.tts.v1.Voice} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Voice, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Voice|undefined} value - * @return {!proto.nuance.tts.v1.GetVoicesRequest} returns this -*/ -proto.nuance.tts.v1.GetVoicesRequest.prototype.setVoice = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.GetVoicesRequest} returns this - */ -proto.nuance.tts.v1.GetVoicesRequest.prototype.clearVoice = function() { - return this.setVoice(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.GetVoicesRequest.prototype.hasVoice = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nuance.tts.v1.GetVoicesResponse.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.GetVoicesResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.GetVoicesResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.GetVoicesResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.GetVoicesResponse.toObject = function(includeInstance, msg) { - var f, obj = { - voicesList: jspb.Message.toObjectList(msg.getVoicesList(), - proto.nuance.tts.v1.Voice.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.GetVoicesResponse} - */ -proto.nuance.tts.v1.GetVoicesResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.GetVoicesResponse; - return proto.nuance.tts.v1.GetVoicesResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.GetVoicesResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.GetVoicesResponse} - */ -proto.nuance.tts.v1.GetVoicesResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Voice; - reader.readMessage(value,proto.nuance.tts.v1.Voice.deserializeBinaryFromReader); - msg.addVoices(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.GetVoicesResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.GetVoicesResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.GetVoicesResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.GetVoicesResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVoicesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nuance.tts.v1.Voice.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Voice voices = 1; - * @return {!Array} - */ -proto.nuance.tts.v1.GetVoicesResponse.prototype.getVoicesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nuance.tts.v1.Voice, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nuance.tts.v1.GetVoicesResponse} returns this -*/ -proto.nuance.tts.v1.GetVoicesResponse.prototype.setVoicesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nuance.tts.v1.Voice=} opt_value - * @param {number=} opt_index - * @return {!proto.nuance.tts.v1.Voice} - */ -proto.nuance.tts.v1.GetVoicesResponse.prototype.addVoices = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nuance.tts.v1.Voice, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nuance.tts.v1.GetVoicesResponse} returns this - */ -proto.nuance.tts.v1.GetVoicesResponse.prototype.clearVoicesList = function() { - return this.setVoicesList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.SynthesisRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.SynthesisRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisRequest.toObject = function(includeInstance, msg) { - var f, obj = { - voice: (f = msg.getVoice()) && proto.nuance.tts.v1.Voice.toObject(includeInstance, f), - audioParams: (f = msg.getAudioParams()) && proto.nuance.tts.v1.AudioParameters.toObject(includeInstance, f), - input: (f = msg.getInput()) && proto.nuance.tts.v1.Input.toObject(includeInstance, f), - eventParams: (f = msg.getEventParams()) && proto.nuance.tts.v1.EventParameters.toObject(includeInstance, f), - clientDataMap: (f = msg.getClientDataMap()) ? f.toObject(includeInstance, undefined) : [], - userId: jspb.Message.getFieldWithDefault(msg, 6, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.SynthesisRequest} - */ -proto.nuance.tts.v1.SynthesisRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.SynthesisRequest; - return proto.nuance.tts.v1.SynthesisRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.SynthesisRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.SynthesisRequest} - */ -proto.nuance.tts.v1.SynthesisRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Voice; - reader.readMessage(value,proto.nuance.tts.v1.Voice.deserializeBinaryFromReader); - msg.setVoice(value); - break; - case 2: - var value = new proto.nuance.tts.v1.AudioParameters; - reader.readMessage(value,proto.nuance.tts.v1.AudioParameters.deserializeBinaryFromReader); - msg.setAudioParams(value); - break; - case 3: - var value = new proto.nuance.tts.v1.Input; - reader.readMessage(value,proto.nuance.tts.v1.Input.deserializeBinaryFromReader); - msg.setInput(value); - break; - case 4: - var value = new proto.nuance.tts.v1.EventParameters; - reader.readMessage(value,proto.nuance.tts.v1.EventParameters.deserializeBinaryFromReader); - msg.setEventParams(value); - break; - case 5: - var value = msg.getClientDataMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setUserId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.SynthesisRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.SynthesisRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVoice(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.Voice.serializeBinaryToWriter - ); - } - f = message.getAudioParams(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.AudioParameters.serializeBinaryToWriter - ); - } - f = message.getInput(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nuance.tts.v1.Input.serializeBinaryToWriter - ); - } - f = message.getEventParams(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.nuance.tts.v1.EventParameters.serializeBinaryToWriter - ); - } - f = message.getClientDataMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } -}; - - -/** - * optional Voice voice = 1; - * @return {?proto.nuance.tts.v1.Voice} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getVoice = function() { - return /** @type{?proto.nuance.tts.v1.Voice} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Voice, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Voice|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this -*/ -proto.nuance.tts.v1.SynthesisRequest.prototype.setVoice = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.clearVoice = function() { - return this.setVoice(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.hasVoice = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional AudioParameters audio_params = 2; - * @return {?proto.nuance.tts.v1.AudioParameters} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getAudioParams = function() { - return /** @type{?proto.nuance.tts.v1.AudioParameters} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.AudioParameters, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.AudioParameters|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this -*/ -proto.nuance.tts.v1.SynthesisRequest.prototype.setAudioParams = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.clearAudioParams = function() { - return this.setAudioParams(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.hasAudioParams = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional Input input = 3; - * @return {?proto.nuance.tts.v1.Input} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getInput = function() { - return /** @type{?proto.nuance.tts.v1.Input} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Input, 3)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Input|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this -*/ -proto.nuance.tts.v1.SynthesisRequest.prototype.setInput = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.clearInput = function() { - return this.setInput(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.hasInput = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional EventParameters event_params = 4; - * @return {?proto.nuance.tts.v1.EventParameters} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getEventParams = function() { - return /** @type{?proto.nuance.tts.v1.EventParameters} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.EventParameters, 4)); -}; - - -/** - * @param {?proto.nuance.tts.v1.EventParameters|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this -*/ -proto.nuance.tts.v1.SynthesisRequest.prototype.setEventParams = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.clearEventParams = function() { - return this.setEventParams(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.hasEventParams = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * map client_data = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getClientDataMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.clearClientDataMap = function() { - this.getClientDataMap().clear(); - return this;}; - - -/** - * optional string user_id = 6; - * @return {string} - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.SynthesisRequest} returns this - */ -proto.nuance.tts.v1.SynthesisRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Voice.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Voice.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Voice} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Voice.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - model: jspb.Message.getFieldWithDefault(msg, 2, ""), - language: jspb.Message.getFieldWithDefault(msg, 3, ""), - ageGroup: jspb.Message.getFieldWithDefault(msg, 4, 0), - gender: jspb.Message.getFieldWithDefault(msg, 5, 0), - sampleRateHz: jspb.Message.getFieldWithDefault(msg, 6, 0), - languageTlw: jspb.Message.getFieldWithDefault(msg, 7, ""), - restricted: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), - version: jspb.Message.getFieldWithDefault(msg, 9, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Voice} - */ -proto.nuance.tts.v1.Voice.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Voice; - return proto.nuance.tts.v1.Voice.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Voice} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Voice} - */ -proto.nuance.tts.v1.Voice.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setModel(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setLanguage(value); - break; - case 4: - var value = /** @type {!proto.nuance.tts.v1.EnumAgeGroup} */ (reader.readEnum()); - msg.setAgeGroup(value); - break; - case 5: - var value = /** @type {!proto.nuance.tts.v1.EnumGender} */ (reader.readEnum()); - msg.setGender(value); - break; - case 6: - var value = /** @type {number} */ (reader.readUint32()); - msg.setSampleRateHz(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setLanguageTlw(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setRestricted(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setVersion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Voice.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Voice.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Voice} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Voice.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getModel(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getLanguage(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getAgeGroup(); - if (f !== 0.0) { - writer.writeEnum( - 4, - f - ); - } - f = message.getGender(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } - f = message.getSampleRateHz(); - if (f !== 0) { - writer.writeUint32( - 6, - f - ); - } - f = message.getLanguageTlw(); - if (f.length > 0) { - writer.writeString( - 7, - f - ); - } - f = message.getRestricted(); - if (f) { - writer.writeBool( - 8, - f - ); - } - f = message.getVersion(); - if (f.length > 0) { - writer.writeString( - 9, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.nuance.tts.v1.Voice.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string model = 2; - * @return {string} - */ -proto.nuance.tts.v1.Voice.prototype.getModel = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setModel = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string language = 3; - * @return {string} - */ -proto.nuance.tts.v1.Voice.prototype.getLanguage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setLanguage = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional EnumAgeGroup age_group = 4; - * @return {!proto.nuance.tts.v1.EnumAgeGroup} - */ -proto.nuance.tts.v1.Voice.prototype.getAgeGroup = function() { - return /** @type {!proto.nuance.tts.v1.EnumAgeGroup} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumAgeGroup} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setAgeGroup = function(value) { - return jspb.Message.setProto3EnumField(this, 4, value); -}; - - -/** - * optional EnumGender gender = 5; - * @return {!proto.nuance.tts.v1.EnumGender} - */ -proto.nuance.tts.v1.Voice.prototype.getGender = function() { - return /** @type {!proto.nuance.tts.v1.EnumGender} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumGender} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setGender = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - -/** - * optional uint32 sample_rate_hz = 6; - * @return {number} - */ -proto.nuance.tts.v1.Voice.prototype.getSampleRateHz = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setSampleRateHz = function(value) { - return jspb.Message.setProto3IntField(this, 6, value); -}; - - -/** - * optional string language_tlw = 7; - * @return {string} - */ -proto.nuance.tts.v1.Voice.prototype.getLanguageTlw = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setLanguageTlw = function(value) { - return jspb.Message.setProto3StringField(this, 7, value); -}; - - -/** - * optional bool restricted = 8; - * @return {boolean} - */ -proto.nuance.tts.v1.Voice.prototype.getRestricted = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setRestricted = function(value) { - return jspb.Message.setProto3BooleanField(this, 8, value); -}; - - -/** - * optional string version = 9; - * @return {string} - */ -proto.nuance.tts.v1.Voice.prototype.getVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Voice} returns this - */ -proto.nuance.tts.v1.Voice.prototype.setVersion = function(value) { - return jspb.Message.setProto3StringField(this, 9, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.AudioParameters.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.AudioParameters.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.AudioParameters} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.AudioParameters.toObject = function(includeInstance, msg) { - var f, obj = { - audioFormat: (f = msg.getAudioFormat()) && proto.nuance.tts.v1.AudioFormat.toObject(includeInstance, f), - volumePercentage: jspb.Message.getFieldWithDefault(msg, 2, 0), - speakingRateFactor: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), - audioChunkDurationMs: jspb.Message.getFieldWithDefault(msg, 4, 0), - targetAudioLengthMs: jspb.Message.getFieldWithDefault(msg, 5, 0), - disableEarlyEmission: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.AudioParameters} - */ -proto.nuance.tts.v1.AudioParameters.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.AudioParameters; - return proto.nuance.tts.v1.AudioParameters.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.AudioParameters} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.AudioParameters} - */ -proto.nuance.tts.v1.AudioParameters.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.AudioFormat; - reader.readMessage(value,proto.nuance.tts.v1.AudioFormat.deserializeBinaryFromReader); - msg.setAudioFormat(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setVolumePercentage(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setSpeakingRateFactor(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setAudioChunkDurationMs(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint32()); - msg.setTargetAudioLengthMs(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDisableEarlyEmission(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.AudioParameters.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.AudioParameters.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.AudioParameters} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.AudioParameters.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAudioFormat(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.AudioFormat.serializeBinaryToWriter - ); - } - f = message.getVolumePercentage(); - if (f !== 0) { - writer.writeUint32( - 2, - f - ); - } - f = message.getSpeakingRateFactor(); - if (f !== 0.0) { - writer.writeFloat( - 3, - f - ); - } - f = message.getAudioChunkDurationMs(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } - f = message.getTargetAudioLengthMs(); - if (f !== 0) { - writer.writeUint32( - 5, - f - ); - } - f = message.getDisableEarlyEmission(); - if (f) { - writer.writeBool( - 6, - f - ); - } -}; - - -/** - * optional AudioFormat audio_format = 1; - * @return {?proto.nuance.tts.v1.AudioFormat} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getAudioFormat = function() { - return /** @type{?proto.nuance.tts.v1.AudioFormat} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.AudioFormat, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.AudioFormat|undefined} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this -*/ -proto.nuance.tts.v1.AudioParameters.prototype.setAudioFormat = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.clearAudioFormat = function() { - return this.setAudioFormat(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioParameters.prototype.hasAudioFormat = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint32 volume_percentage = 2; - * @return {number} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getVolumePercentage = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.setVolumePercentage = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional float speaking_rate_factor = 3; - * @return {number} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getSpeakingRateFactor = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.setSpeakingRateFactor = function(value) { - return jspb.Message.setProto3FloatField(this, 3, value); -}; - - -/** - * optional uint32 audio_chunk_duration_ms = 4; - * @return {number} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getAudioChunkDurationMs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.setAudioChunkDurationMs = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * optional uint32 target_audio_length_ms = 5; - * @return {number} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getTargetAudioLengthMs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.setTargetAudioLengthMs = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); -}; - - -/** - * optional bool disable_early_emission = 6; - * @return {boolean} - */ -proto.nuance.tts.v1.AudioParameters.prototype.getDisableEarlyEmission = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.AudioParameters} returns this - */ -proto.nuance.tts.v1.AudioParameters.prototype.setDisableEarlyEmission = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.AudioFormat.oneofGroups_ = [[1,2,3,4,5]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.AudioFormat.AudioFormatCase = { - AUDIO_FORMAT_NOT_SET: 0, - PCM: 1, - ALAW: 2, - ULAW: 3, - OGG_OPUS: 4, - OPUS: 5 -}; - -/** - * @return {proto.nuance.tts.v1.AudioFormat.AudioFormatCase} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getAudioFormatCase = function() { - return /** @type {proto.nuance.tts.v1.AudioFormat.AudioFormatCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.AudioFormat.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.AudioFormat.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.AudioFormat} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.AudioFormat.toObject = function(includeInstance, msg) { - var f, obj = { - pcm: (f = msg.getPcm()) && proto.nuance.tts.v1.PCM.toObject(includeInstance, f), - alaw: (f = msg.getAlaw()) && proto.nuance.tts.v1.ALaw.toObject(includeInstance, f), - ulaw: (f = msg.getUlaw()) && proto.nuance.tts.v1.ULaw.toObject(includeInstance, f), - oggOpus: (f = msg.getOggOpus()) && proto.nuance.tts.v1.OggOpus.toObject(includeInstance, f), - opus: (f = msg.getOpus()) && proto.nuance.tts.v1.Opus.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.AudioFormat} - */ -proto.nuance.tts.v1.AudioFormat.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.AudioFormat; - return proto.nuance.tts.v1.AudioFormat.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.AudioFormat} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.AudioFormat} - */ -proto.nuance.tts.v1.AudioFormat.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.PCM; - reader.readMessage(value,proto.nuance.tts.v1.PCM.deserializeBinaryFromReader); - msg.setPcm(value); - break; - case 2: - var value = new proto.nuance.tts.v1.ALaw; - reader.readMessage(value,proto.nuance.tts.v1.ALaw.deserializeBinaryFromReader); - msg.setAlaw(value); - break; - case 3: - var value = new proto.nuance.tts.v1.ULaw; - reader.readMessage(value,proto.nuance.tts.v1.ULaw.deserializeBinaryFromReader); - msg.setUlaw(value); - break; - case 4: - var value = new proto.nuance.tts.v1.OggOpus; - reader.readMessage(value,proto.nuance.tts.v1.OggOpus.deserializeBinaryFromReader); - msg.setOggOpus(value); - break; - case 5: - var value = new proto.nuance.tts.v1.Opus; - reader.readMessage(value,proto.nuance.tts.v1.Opus.deserializeBinaryFromReader); - msg.setOpus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.AudioFormat.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.AudioFormat.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.AudioFormat} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.AudioFormat.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPcm(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.PCM.serializeBinaryToWriter - ); - } - f = message.getAlaw(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.ALaw.serializeBinaryToWriter - ); - } - f = message.getUlaw(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nuance.tts.v1.ULaw.serializeBinaryToWriter - ); - } - f = message.getOggOpus(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.nuance.tts.v1.OggOpus.serializeBinaryToWriter - ); - } - f = message.getOpus(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.nuance.tts.v1.Opus.serializeBinaryToWriter - ); - } -}; - - -/** - * optional PCM pcm = 1; - * @return {?proto.nuance.tts.v1.PCM} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getPcm = function() { - return /** @type{?proto.nuance.tts.v1.PCM} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.PCM, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.PCM|undefined} value - * @return {!proto.nuance.tts.v1.AudioFormat} returns this -*/ -proto.nuance.tts.v1.AudioFormat.prototype.setPcm = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioFormat} returns this - */ -proto.nuance.tts.v1.AudioFormat.prototype.clearPcm = function() { - return this.setPcm(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioFormat.prototype.hasPcm = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional ALaw alaw = 2; - * @return {?proto.nuance.tts.v1.ALaw} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getAlaw = function() { - return /** @type{?proto.nuance.tts.v1.ALaw} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.ALaw, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.ALaw|undefined} value - * @return {!proto.nuance.tts.v1.AudioFormat} returns this -*/ -proto.nuance.tts.v1.AudioFormat.prototype.setAlaw = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioFormat} returns this - */ -proto.nuance.tts.v1.AudioFormat.prototype.clearAlaw = function() { - return this.setAlaw(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioFormat.prototype.hasAlaw = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional ULaw ulaw = 3; - * @return {?proto.nuance.tts.v1.ULaw} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getUlaw = function() { - return /** @type{?proto.nuance.tts.v1.ULaw} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.ULaw, 3)); -}; - - -/** - * @param {?proto.nuance.tts.v1.ULaw|undefined} value - * @return {!proto.nuance.tts.v1.AudioFormat} returns this -*/ -proto.nuance.tts.v1.AudioFormat.prototype.setUlaw = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioFormat} returns this - */ -proto.nuance.tts.v1.AudioFormat.prototype.clearUlaw = function() { - return this.setUlaw(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioFormat.prototype.hasUlaw = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional OggOpus ogg_opus = 4; - * @return {?proto.nuance.tts.v1.OggOpus} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getOggOpus = function() { - return /** @type{?proto.nuance.tts.v1.OggOpus} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.OggOpus, 4)); -}; - - -/** - * @param {?proto.nuance.tts.v1.OggOpus|undefined} value - * @return {!proto.nuance.tts.v1.AudioFormat} returns this -*/ -proto.nuance.tts.v1.AudioFormat.prototype.setOggOpus = function(value) { - return jspb.Message.setOneofWrapperField(this, 4, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioFormat} returns this - */ -proto.nuance.tts.v1.AudioFormat.prototype.clearOggOpus = function() { - return this.setOggOpus(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioFormat.prototype.hasOggOpus = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional Opus opus = 5; - * @return {?proto.nuance.tts.v1.Opus} - */ -proto.nuance.tts.v1.AudioFormat.prototype.getOpus = function() { - return /** @type{?proto.nuance.tts.v1.Opus} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Opus, 5)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Opus|undefined} value - * @return {!proto.nuance.tts.v1.AudioFormat} returns this -*/ -proto.nuance.tts.v1.AudioFormat.prototype.setOpus = function(value) { - return jspb.Message.setOneofWrapperField(this, 5, proto.nuance.tts.v1.AudioFormat.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.AudioFormat} returns this - */ -proto.nuance.tts.v1.AudioFormat.prototype.clearOpus = function() { - return this.setOpus(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.AudioFormat.prototype.hasOpus = function() { - return jspb.Message.getField(this, 5) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.PCM.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.PCM.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.PCM} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.PCM.toObject = function(includeInstance, msg) { - var f, obj = { - sampleRateHz: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.PCM} - */ -proto.nuance.tts.v1.PCM.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.PCM; - return proto.nuance.tts.v1.PCM.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.PCM} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.PCM} - */ -proto.nuance.tts.v1.PCM.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setSampleRateHz(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.PCM.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.PCM.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.PCM} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.PCM.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSampleRateHz(); - if (f !== 0) { - writer.writeUint32( - 1, - f - ); - } -}; - - -/** - * optional uint32 sample_rate_hz = 1; - * @return {number} - */ -proto.nuance.tts.v1.PCM.prototype.getSampleRateHz = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.PCM} returns this - */ -proto.nuance.tts.v1.PCM.prototype.setSampleRateHz = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.ALaw.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.ALaw.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.ALaw} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ALaw.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.ALaw} - */ -proto.nuance.tts.v1.ALaw.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.ALaw; - return proto.nuance.tts.v1.ALaw.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.ALaw} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.ALaw} - */ -proto.nuance.tts.v1.ALaw.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.ALaw.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.ALaw.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.ALaw} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ALaw.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.ULaw.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.ULaw.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.ULaw} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ULaw.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.ULaw} - */ -proto.nuance.tts.v1.ULaw.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.ULaw; - return proto.nuance.tts.v1.ULaw.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.ULaw} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.ULaw} - */ -proto.nuance.tts.v1.ULaw.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.ULaw.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.ULaw.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.ULaw} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ULaw.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Opus.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Opus.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Opus} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Opus.toObject = function(includeInstance, msg) { - var f, obj = { - sampleRateHz: jspb.Message.getFieldWithDefault(msg, 1, 0), - bitRateBps: jspb.Message.getFieldWithDefault(msg, 2, 0), - maxFrameDurationMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), - complexity: jspb.Message.getFieldWithDefault(msg, 4, 0), - vbr: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Opus} - */ -proto.nuance.tts.v1.Opus.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Opus; - return proto.nuance.tts.v1.Opus.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Opus} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Opus} - */ -proto.nuance.tts.v1.Opus.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setSampleRateHz(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setBitRateBps(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setMaxFrameDurationMs(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setComplexity(value); - break; - case 5: - var value = /** @type {!proto.nuance.tts.v1.EnumVariableBitrate} */ (reader.readEnum()); - msg.setVbr(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Opus.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Opus.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Opus} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Opus.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSampleRateHz(); - if (f !== 0) { - writer.writeUint32( - 1, - f - ); - } - f = message.getBitRateBps(); - if (f !== 0) { - writer.writeUint32( - 2, - f - ); - } - f = message.getMaxFrameDurationMs(); - if (f !== 0.0) { - writer.writeFloat( - 3, - f - ); - } - f = message.getComplexity(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } - f = message.getVbr(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } -}; - - -/** - * optional uint32 sample_rate_hz = 1; - * @return {number} - */ -proto.nuance.tts.v1.Opus.prototype.getSampleRateHz = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Opus} returns this - */ -proto.nuance.tts.v1.Opus.prototype.setSampleRateHz = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional uint32 bit_rate_bps = 2; - * @return {number} - */ -proto.nuance.tts.v1.Opus.prototype.getBitRateBps = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Opus} returns this - */ -proto.nuance.tts.v1.Opus.prototype.setBitRateBps = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional float max_frame_duration_ms = 3; - * @return {number} - */ -proto.nuance.tts.v1.Opus.prototype.getMaxFrameDurationMs = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Opus} returns this - */ -proto.nuance.tts.v1.Opus.prototype.setMaxFrameDurationMs = function(value) { - return jspb.Message.setProto3FloatField(this, 3, value); -}; - - -/** - * optional uint32 complexity = 4; - * @return {number} - */ -proto.nuance.tts.v1.Opus.prototype.getComplexity = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Opus} returns this - */ -proto.nuance.tts.v1.Opus.prototype.setComplexity = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * optional EnumVariableBitrate vbr = 5; - * @return {!proto.nuance.tts.v1.EnumVariableBitrate} - */ -proto.nuance.tts.v1.Opus.prototype.getVbr = function() { - return /** @type {!proto.nuance.tts.v1.EnumVariableBitrate} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumVariableBitrate} value - * @return {!proto.nuance.tts.v1.Opus} returns this - */ -proto.nuance.tts.v1.Opus.prototype.setVbr = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.OggOpus.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.OggOpus.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.OggOpus} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.OggOpus.toObject = function(includeInstance, msg) { - var f, obj = { - sampleRateHz: jspb.Message.getFieldWithDefault(msg, 1, 0), - bitRateBps: jspb.Message.getFieldWithDefault(msg, 2, 0), - maxFrameDurationMs: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), - complexity: jspb.Message.getFieldWithDefault(msg, 4, 0), - vbr: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.OggOpus} - */ -proto.nuance.tts.v1.OggOpus.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.OggOpus; - return proto.nuance.tts.v1.OggOpus.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.OggOpus} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.OggOpus} - */ -proto.nuance.tts.v1.OggOpus.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setSampleRateHz(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setBitRateBps(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setMaxFrameDurationMs(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setComplexity(value); - break; - case 5: - var value = /** @type {!proto.nuance.tts.v1.EnumVariableBitrate} */ (reader.readEnum()); - msg.setVbr(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.OggOpus.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.OggOpus.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.OggOpus} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.OggOpus.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSampleRateHz(); - if (f !== 0) { - writer.writeUint32( - 1, - f - ); - } - f = message.getBitRateBps(); - if (f !== 0) { - writer.writeUint32( - 2, - f - ); - } - f = message.getMaxFrameDurationMs(); - if (f !== 0.0) { - writer.writeFloat( - 3, - f - ); - } - f = message.getComplexity(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } - f = message.getVbr(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } -}; - - -/** - * optional uint32 sample_rate_hz = 1; - * @return {number} - */ -proto.nuance.tts.v1.OggOpus.prototype.getSampleRateHz = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.OggOpus} returns this - */ -proto.nuance.tts.v1.OggOpus.prototype.setSampleRateHz = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional uint32 bit_rate_bps = 2; - * @return {number} - */ -proto.nuance.tts.v1.OggOpus.prototype.getBitRateBps = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.OggOpus} returns this - */ -proto.nuance.tts.v1.OggOpus.prototype.setBitRateBps = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional float max_frame_duration_ms = 3; - * @return {number} - */ -proto.nuance.tts.v1.OggOpus.prototype.getMaxFrameDurationMs = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.OggOpus} returns this - */ -proto.nuance.tts.v1.OggOpus.prototype.setMaxFrameDurationMs = function(value) { - return jspb.Message.setProto3FloatField(this, 3, value); -}; - - -/** - * optional uint32 complexity = 4; - * @return {number} - */ -proto.nuance.tts.v1.OggOpus.prototype.getComplexity = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.OggOpus} returns this - */ -proto.nuance.tts.v1.OggOpus.prototype.setComplexity = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * optional EnumVariableBitrate vbr = 5; - * @return {!proto.nuance.tts.v1.EnumVariableBitrate} - */ -proto.nuance.tts.v1.OggOpus.prototype.getVbr = function() { - return /** @type {!proto.nuance.tts.v1.EnumVariableBitrate} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumVariableBitrate} value - * @return {!proto.nuance.tts.v1.OggOpus} returns this - */ -proto.nuance.tts.v1.OggOpus.prototype.setVbr = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nuance.tts.v1.Input.repeatedFields_ = [4]; - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.Input.oneofGroups_ = [[1,2,3]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.Input.InputDataCase = { - INPUT_DATA_NOT_SET: 0, - TEXT: 1, - SSML: 2, - TOKENIZED_SEQUENCE: 3 -}; - -/** - * @return {proto.nuance.tts.v1.Input.InputDataCase} - */ -proto.nuance.tts.v1.Input.prototype.getInputDataCase = function() { - return /** @type {proto.nuance.tts.v1.Input.InputDataCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.Input.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Input.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Input.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Input} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Input.toObject = function(includeInstance, msg) { - var f, obj = { - text: (f = msg.getText()) && proto.nuance.tts.v1.Text.toObject(includeInstance, f), - ssml: (f = msg.getSsml()) && proto.nuance.tts.v1.SSML.toObject(includeInstance, f), - tokenizedSequence: (f = msg.getTokenizedSequence()) && proto.nuance.tts.v1.TokenizedSequence.toObject(includeInstance, f), - resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), - proto.nuance.tts.v1.SynthesisResource.toObject, includeInstance), - lidParams: (f = msg.getLidParams()) && proto.nuance.tts.v1.LanguageIdentificationParameters.toObject(includeInstance, f), - downloadParams: (f = msg.getDownloadParams()) && proto.nuance.tts.v1.DownloadParameters.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Input} - */ -proto.nuance.tts.v1.Input.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Input; - return proto.nuance.tts.v1.Input.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Input} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Input} - */ -proto.nuance.tts.v1.Input.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Text; - reader.readMessage(value,proto.nuance.tts.v1.Text.deserializeBinaryFromReader); - msg.setText(value); - break; - case 2: - var value = new proto.nuance.tts.v1.SSML; - reader.readMessage(value,proto.nuance.tts.v1.SSML.deserializeBinaryFromReader); - msg.setSsml(value); - break; - case 3: - var value = new proto.nuance.tts.v1.TokenizedSequence; - reader.readMessage(value,proto.nuance.tts.v1.TokenizedSequence.deserializeBinaryFromReader); - msg.setTokenizedSequence(value); - break; - case 4: - var value = new proto.nuance.tts.v1.SynthesisResource; - reader.readMessage(value,proto.nuance.tts.v1.SynthesisResource.deserializeBinaryFromReader); - msg.addResources(value); - break; - case 5: - var value = new proto.nuance.tts.v1.LanguageIdentificationParameters; - reader.readMessage(value,proto.nuance.tts.v1.LanguageIdentificationParameters.deserializeBinaryFromReader); - msg.setLidParams(value); - break; - case 6: - var value = new proto.nuance.tts.v1.DownloadParameters; - reader.readMessage(value,proto.nuance.tts.v1.DownloadParameters.deserializeBinaryFromReader); - msg.setDownloadParams(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Input.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Input.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Input} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Input.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getText(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.Text.serializeBinaryToWriter - ); - } - f = message.getSsml(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.SSML.serializeBinaryToWriter - ); - } - f = message.getTokenizedSequence(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nuance.tts.v1.TokenizedSequence.serializeBinaryToWriter - ); - } - f = message.getResourcesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.nuance.tts.v1.SynthesisResource.serializeBinaryToWriter - ); - } - f = message.getLidParams(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.nuance.tts.v1.LanguageIdentificationParameters.serializeBinaryToWriter - ); - } - f = message.getDownloadParams(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.nuance.tts.v1.DownloadParameters.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Text text = 1; - * @return {?proto.nuance.tts.v1.Text} - */ -proto.nuance.tts.v1.Input.prototype.getText = function() { - return /** @type{?proto.nuance.tts.v1.Text} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Text, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Text|undefined} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setText = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nuance.tts.v1.Input.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearText = function() { - return this.setText(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Input.prototype.hasText = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional SSML ssml = 2; - * @return {?proto.nuance.tts.v1.SSML} - */ -proto.nuance.tts.v1.Input.prototype.getSsml = function() { - return /** @type{?proto.nuance.tts.v1.SSML} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.SSML, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.SSML|undefined} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setSsml = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nuance.tts.v1.Input.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearSsml = function() { - return this.setSsml(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Input.prototype.hasSsml = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional TokenizedSequence tokenized_sequence = 3; - * @return {?proto.nuance.tts.v1.TokenizedSequence} - */ -proto.nuance.tts.v1.Input.prototype.getTokenizedSequence = function() { - return /** @type{?proto.nuance.tts.v1.TokenizedSequence} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.TokenizedSequence, 3)); -}; - - -/** - * @param {?proto.nuance.tts.v1.TokenizedSequence|undefined} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setTokenizedSequence = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.nuance.tts.v1.Input.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearTokenizedSequence = function() { - return this.setTokenizedSequence(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Input.prototype.hasTokenizedSequence = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * repeated SynthesisResource resources = 4; - * @return {!Array} - */ -proto.nuance.tts.v1.Input.prototype.getResourcesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nuance.tts.v1.SynthesisResource, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setResourcesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.nuance.tts.v1.SynthesisResource=} opt_value - * @param {number=} opt_index - * @return {!proto.nuance.tts.v1.SynthesisResource} - */ -proto.nuance.tts.v1.Input.prototype.addResources = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.nuance.tts.v1.SynthesisResource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearResourcesList = function() { - return this.setResourcesList([]); -}; - - -/** - * optional LanguageIdentificationParameters lid_params = 5; - * @return {?proto.nuance.tts.v1.LanguageIdentificationParameters} - */ -proto.nuance.tts.v1.Input.prototype.getLidParams = function() { - return /** @type{?proto.nuance.tts.v1.LanguageIdentificationParameters} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.LanguageIdentificationParameters, 5)); -}; - - -/** - * @param {?proto.nuance.tts.v1.LanguageIdentificationParameters|undefined} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setLidParams = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearLidParams = function() { - return this.setLidParams(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Input.prototype.hasLidParams = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional DownloadParameters download_params = 6; - * @return {?proto.nuance.tts.v1.DownloadParameters} - */ -proto.nuance.tts.v1.Input.prototype.getDownloadParams = function() { - return /** @type{?proto.nuance.tts.v1.DownloadParameters} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.DownloadParameters, 6)); -}; - - -/** - * @param {?proto.nuance.tts.v1.DownloadParameters|undefined} value - * @return {!proto.nuance.tts.v1.Input} returns this -*/ -proto.nuance.tts.v1.Input.prototype.setDownloadParams = function(value) { - return jspb.Message.setWrapperField(this, 6, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Input} returns this - */ -proto.nuance.tts.v1.Input.prototype.clearDownloadParams = function() { - return this.setDownloadParams(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Input.prototype.hasDownloadParams = function() { - return jspb.Message.getField(this, 6) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.Text.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.Text.TextDataCase = { - TEXT_DATA_NOT_SET: 0, - TEXT: 1, - URI: 2 -}; - -/** - * @return {proto.nuance.tts.v1.Text.TextDataCase} - */ -proto.nuance.tts.v1.Text.prototype.getTextDataCase = function() { - return /** @type {proto.nuance.tts.v1.Text.TextDataCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.Text.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Text.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Text.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Text} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Text.toObject = function(includeInstance, msg) { - var f, obj = { - text: jspb.Message.getFieldWithDefault(msg, 1, ""), - uri: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Text} - */ -proto.nuance.tts.v1.Text.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Text; - return proto.nuance.tts.v1.Text.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Text} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Text} - */ -proto.nuance.tts.v1.Text.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setText(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUri(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Text.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Text.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Text} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Text.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string text = 1; - * @return {string} - */ -proto.nuance.tts.v1.Text.prototype.getText = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Text} returns this - */ -proto.nuance.tts.v1.Text.prototype.setText = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.Text.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.Text} returns this - */ -proto.nuance.tts.v1.Text.prototype.clearText = function() { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.Text.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Text.prototype.hasText = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string uri = 2; - * @return {string} - */ -proto.nuance.tts.v1.Text.prototype.getUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Text} returns this - */ -proto.nuance.tts.v1.Text.prototype.setUri = function(value) { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.Text.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.Text} returns this - */ -proto.nuance.tts.v1.Text.prototype.clearUri = function() { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.Text.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Text.prototype.hasUri = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.SSML.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.SSML.SsmlDataCase = { - SSML_DATA_NOT_SET: 0, - TEXT: 1, - URI: 2 -}; - -/** - * @return {proto.nuance.tts.v1.SSML.SsmlDataCase} - */ -proto.nuance.tts.v1.SSML.prototype.getSsmlDataCase = function() { - return /** @type {proto.nuance.tts.v1.SSML.SsmlDataCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.SSML.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.SSML.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.SSML.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.SSML} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SSML.toObject = function(includeInstance, msg) { - var f, obj = { - text: jspb.Message.getFieldWithDefault(msg, 1, ""), - uri: jspb.Message.getFieldWithDefault(msg, 2, ""), - ssmlValidationMode: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.SSML} - */ -proto.nuance.tts.v1.SSML.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.SSML; - return proto.nuance.tts.v1.SSML.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.SSML} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.SSML} - */ -proto.nuance.tts.v1.SSML.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setText(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUri(value); - break; - case 3: - var value = /** @type {!proto.nuance.tts.v1.EnumSSMLValidationMode} */ (reader.readEnum()); - msg.setSsmlValidationMode(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SSML.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.SSML.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.SSML} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SSML.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } - f = message.getSsmlValidationMode(); - if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); - } -}; - - -/** - * optional string text = 1; - * @return {string} - */ -proto.nuance.tts.v1.SSML.prototype.getText = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.SSML} returns this - */ -proto.nuance.tts.v1.SSML.prototype.setText = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.SSML.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.SSML} returns this - */ -proto.nuance.tts.v1.SSML.prototype.clearText = function() { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.SSML.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SSML.prototype.hasText = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string uri = 2; - * @return {string} - */ -proto.nuance.tts.v1.SSML.prototype.getUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.SSML} returns this - */ -proto.nuance.tts.v1.SSML.prototype.setUri = function(value) { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.SSML.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.SSML} returns this - */ -proto.nuance.tts.v1.SSML.prototype.clearUri = function() { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.SSML.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SSML.prototype.hasUri = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional EnumSSMLValidationMode ssml_validation_mode = 3; - * @return {!proto.nuance.tts.v1.EnumSSMLValidationMode} - */ -proto.nuance.tts.v1.SSML.prototype.getSsmlValidationMode = function() { - return /** @type {!proto.nuance.tts.v1.EnumSSMLValidationMode} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumSSMLValidationMode} value - * @return {!proto.nuance.tts.v1.SSML} returns this - */ -proto.nuance.tts.v1.SSML.prototype.setSsmlValidationMode = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nuance.tts.v1.TokenizedSequence.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.TokenizedSequence.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.TokenizedSequence.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.TokenizedSequence} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.TokenizedSequence.toObject = function(includeInstance, msg) { - var f, obj = { - tokensList: jspb.Message.toObjectList(msg.getTokensList(), - proto.nuance.tts.v1.Token.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.TokenizedSequence} - */ -proto.nuance.tts.v1.TokenizedSequence.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.TokenizedSequence; - return proto.nuance.tts.v1.TokenizedSequence.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.TokenizedSequence} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.TokenizedSequence} - */ -proto.nuance.tts.v1.TokenizedSequence.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Token; - reader.readMessage(value,proto.nuance.tts.v1.Token.deserializeBinaryFromReader); - msg.addTokens(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.TokenizedSequence.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.TokenizedSequence.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.TokenizedSequence} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.TokenizedSequence.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokensList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nuance.tts.v1.Token.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Token tokens = 1; - * @return {!Array} - */ -proto.nuance.tts.v1.TokenizedSequence.prototype.getTokensList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nuance.tts.v1.Token, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nuance.tts.v1.TokenizedSequence} returns this -*/ -proto.nuance.tts.v1.TokenizedSequence.prototype.setTokensList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nuance.tts.v1.Token=} opt_value - * @param {number=} opt_index - * @return {!proto.nuance.tts.v1.Token} - */ -proto.nuance.tts.v1.TokenizedSequence.prototype.addTokens = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nuance.tts.v1.Token, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nuance.tts.v1.TokenizedSequence} returns this - */ -proto.nuance.tts.v1.TokenizedSequence.prototype.clearTokensList = function() { - return this.setTokensList([]); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.Token.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.Token.TokenDataCase = { - TOKEN_DATA_NOT_SET: 0, - TEXT: 1, - CONTROL_CODE: 2 -}; - -/** - * @return {proto.nuance.tts.v1.Token.TokenDataCase} - */ -proto.nuance.tts.v1.Token.prototype.getTokenDataCase = function() { - return /** @type {proto.nuance.tts.v1.Token.TokenDataCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.Token.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Token.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Token.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Token} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Token.toObject = function(includeInstance, msg) { - var f, obj = { - text: jspb.Message.getFieldWithDefault(msg, 1, ""), - controlCode: (f = msg.getControlCode()) && proto.nuance.tts.v1.ControlCode.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Token} - */ -proto.nuance.tts.v1.Token.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Token; - return proto.nuance.tts.v1.Token.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Token} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Token} - */ -proto.nuance.tts.v1.Token.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setText(value); - break; - case 2: - var value = new proto.nuance.tts.v1.ControlCode; - reader.readMessage(value,proto.nuance.tts.v1.ControlCode.deserializeBinaryFromReader); - msg.setControlCode(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Token.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Token.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Token} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Token.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = message.getControlCode(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.ControlCode.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string text = 1; - * @return {string} - */ -proto.nuance.tts.v1.Token.prototype.getText = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Token} returns this - */ -proto.nuance.tts.v1.Token.prototype.setText = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.Token.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.Token} returns this - */ -proto.nuance.tts.v1.Token.prototype.clearText = function() { - return jspb.Message.setOneofField(this, 1, proto.nuance.tts.v1.Token.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Token.prototype.hasText = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional ControlCode control_code = 2; - * @return {?proto.nuance.tts.v1.ControlCode} - */ -proto.nuance.tts.v1.Token.prototype.getControlCode = function() { - return /** @type{?proto.nuance.tts.v1.ControlCode} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.ControlCode, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.ControlCode|undefined} value - * @return {!proto.nuance.tts.v1.Token} returns this -*/ -proto.nuance.tts.v1.Token.prototype.setControlCode = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nuance.tts.v1.Token.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.Token} returns this - */ -proto.nuance.tts.v1.Token.prototype.clearControlCode = function() { - return this.setControlCode(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.Token.prototype.hasControlCode = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.ControlCode.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.ControlCode.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.ControlCode} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ControlCode.toObject = function(includeInstance, msg) { - var f, obj = { - key: jspb.Message.getFieldWithDefault(msg, 1, ""), - value: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.ControlCode} - */ -proto.nuance.tts.v1.ControlCode.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.ControlCode; - return proto.nuance.tts.v1.ControlCode.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.ControlCode} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.ControlCode} - */ -proto.nuance.tts.v1.ControlCode.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.ControlCode.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.ControlCode.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.ControlCode} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.ControlCode.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getValue(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string key = 1; - * @return {string} - */ -proto.nuance.tts.v1.ControlCode.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.ControlCode} returns this - */ -proto.nuance.tts.v1.ControlCode.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string value = 2; - * @return {string} - */ -proto.nuance.tts.v1.ControlCode.prototype.getValue = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.ControlCode} returns this - */ -proto.nuance.tts.v1.ControlCode.prototype.setValue = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.SynthesisResource.oneofGroups_ = [[2,3]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.SynthesisResource.ResourceDataCase = { - RESOURCE_DATA_NOT_SET: 0, - URI: 2, - BODY: 3 -}; - -/** - * @return {proto.nuance.tts.v1.SynthesisResource.ResourceDataCase} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getResourceDataCase = function() { - return /** @type {proto.nuance.tts.v1.SynthesisResource.ResourceDataCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.SynthesisResource.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.SynthesisResource.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.SynthesisResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisResource.toObject = function(includeInstance, msg) { - var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - uri: jspb.Message.getFieldWithDefault(msg, 2, ""), - body: msg.getBody_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.SynthesisResource} - */ -proto.nuance.tts.v1.SynthesisResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.SynthesisResource; - return proto.nuance.tts.v1.SynthesisResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.SynthesisResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.SynthesisResource} - */ -proto.nuance.tts.v1.SynthesisResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.nuance.tts.v1.EnumResourceType} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUri(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setBody(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.SynthesisResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.SynthesisResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeBytes( - 3, - f - ); - } -}; - - -/** - * optional EnumResourceType type = 1; - * @return {!proto.nuance.tts.v1.EnumResourceType} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getType = function() { - return /** @type {!proto.nuance.tts.v1.EnumResourceType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.nuance.tts.v1.EnumResourceType} value - * @return {!proto.nuance.tts.v1.SynthesisResource} returns this - */ -proto.nuance.tts.v1.SynthesisResource.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string uri = 2; - * @return {string} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.SynthesisResource} returns this - */ -proto.nuance.tts.v1.SynthesisResource.prototype.setUri = function(value) { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.SynthesisResource.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisResource} returns this - */ -proto.nuance.tts.v1.SynthesisResource.prototype.clearUri = function() { - return jspb.Message.setOneofField(this, 2, proto.nuance.tts.v1.SynthesisResource.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.hasUri = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional bytes body = 3; - * @return {!(string|Uint8Array)} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getBody = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes body = 3; - * This is a type-conversion wrapper around `getBody()` - * @return {string} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getBody_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getBody())); -}; - - -/** - * optional bytes body = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getBody()` - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.getBody_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getBody())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nuance.tts.v1.SynthesisResource} returns this - */ -proto.nuance.tts.v1.SynthesisResource.prototype.setBody = function(value) { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.SynthesisResource.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisResource} returns this - */ -proto.nuance.tts.v1.SynthesisResource.prototype.clearBody = function() { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.SynthesisResource.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisResource.prototype.hasBody = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.repeatedFields_ = [2]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.LanguageIdentificationParameters.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.LanguageIdentificationParameters} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.toObject = function(includeInstance, msg) { - var f, obj = { - disable: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - languagesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, - alwaysUseHighestConfidence: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.LanguageIdentificationParameters; - return proto.nuance.tts.v1.LanguageIdentificationParameters.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.LanguageIdentificationParameters} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDisable(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.addLanguages(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAlwaysUseHighestConfidence(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.LanguageIdentificationParameters.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.LanguageIdentificationParameters} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDisable(); - if (f) { - writer.writeBool( - 1, - f - ); - } - f = message.getLanguagesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 2, - f - ); - } - f = message.getAlwaysUseHighestConfidence(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - -/** - * optional bool disable = 1; - * @return {boolean} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.getDisable = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} returns this - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.setDisable = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * repeated string languages = 2; - * @return {!Array} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.getLanguagesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} returns this - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.setLanguagesList = function(value) { - return jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} returns this - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.addLanguages = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} returns this - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.clearLanguagesList = function() { - return this.setLanguagesList([]); -}; - - -/** - * optional bool always_use_highest_confidence = 3; - * @return {boolean} - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.getAlwaysUseHighestConfidence = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.LanguageIdentificationParameters} returns this - */ -proto.nuance.tts.v1.LanguageIdentificationParameters.prototype.setAlwaysUseHighestConfidence = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.DownloadParameters.oneofGroups_ = [[3]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.DownloadParameters.OptionalDownloadParameterRequestTimeoutMsCase = { - OPTIONAL_DOWNLOAD_PARAMETER_REQUEST_TIMEOUT_MS_NOT_SET: 0, - REQUEST_TIMEOUT_MS: 3 -}; - -/** - * @return {proto.nuance.tts.v1.DownloadParameters.OptionalDownloadParameterRequestTimeoutMsCase} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.getOptionalDownloadParameterRequestTimeoutMsCase = function() { - return /** @type {proto.nuance.tts.v1.DownloadParameters.OptionalDownloadParameterRequestTimeoutMsCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.DownloadParameters.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.DownloadParameters.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.DownloadParameters} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.DownloadParameters.toObject = function(includeInstance, msg) { - var f, obj = { - headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, undefined) : [], - refuseCookies: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), - requestTimeoutMs: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.DownloadParameters} - */ -proto.nuance.tts.v1.DownloadParameters.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.DownloadParameters; - return proto.nuance.tts.v1.DownloadParameters.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.DownloadParameters} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.DownloadParameters} - */ -proto.nuance.tts.v1.DownloadParameters.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getHeadersMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setRefuseCookies(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRequestTimeoutMs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.DownloadParameters.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.DownloadParameters} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.DownloadParameters.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getHeadersMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getRefuseCookies(); - if (f) { - writer.writeBool( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeUint32( - 3, - f - ); - } -}; - - -/** - * map headers = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.getHeadersMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nuance.tts.v1.DownloadParameters} returns this - */ -proto.nuance.tts.v1.DownloadParameters.prototype.clearHeadersMap = function() { - this.getHeadersMap().clear(); - return this;}; - - -/** - * optional bool refuse_cookies = 2; - * @return {boolean} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.getRefuseCookies = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.DownloadParameters} returns this - */ -proto.nuance.tts.v1.DownloadParameters.prototype.setRefuseCookies = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - -/** - * optional uint32 request_timeout_ms = 3; - * @return {number} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.getRequestTimeoutMs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.DownloadParameters} returns this - */ -proto.nuance.tts.v1.DownloadParameters.prototype.setRequestTimeoutMs = function(value) { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.DownloadParameters.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.DownloadParameters} returns this - */ -proto.nuance.tts.v1.DownloadParameters.prototype.clearRequestTimeoutMs = function() { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.DownloadParameters.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.DownloadParameters.prototype.hasRequestTimeoutMs = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.EventParameters.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.EventParameters.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.EventParameters} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.EventParameters.toObject = function(includeInstance, msg) { - var f, obj = { - sendSentenceMarkerEvents: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - sendWordMarkerEvents: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), - sendPhonemeMarkerEvents: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - sendBookmarkMarkerEvents: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), - sendParagraphMarkerEvents: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), - sendVisemes: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), - sendLogEvents: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), - suppressInput: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.EventParameters} - */ -proto.nuance.tts.v1.EventParameters.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.EventParameters; - return proto.nuance.tts.v1.EventParameters.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.EventParameters} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.EventParameters} - */ -proto.nuance.tts.v1.EventParameters.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendSentenceMarkerEvents(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendWordMarkerEvents(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendPhonemeMarkerEvents(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendBookmarkMarkerEvents(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendParagraphMarkerEvents(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendVisemes(value); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSendLogEvents(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSuppressInput(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.EventParameters.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.EventParameters.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.EventParameters} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.EventParameters.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSendSentenceMarkerEvents(); - if (f) { - writer.writeBool( - 1, - f - ); - } - f = message.getSendWordMarkerEvents(); - if (f) { - writer.writeBool( - 2, - f - ); - } - f = message.getSendPhonemeMarkerEvents(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getSendBookmarkMarkerEvents(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getSendParagraphMarkerEvents(); - if (f) { - writer.writeBool( - 5, - f - ); - } - f = message.getSendVisemes(); - if (f) { - writer.writeBool( - 6, - f - ); - } - f = message.getSendLogEvents(); - if (f) { - writer.writeBool( - 7, - f - ); - } - f = message.getSuppressInput(); - if (f) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional bool send_sentence_marker_events = 1; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendSentenceMarkerEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendSentenceMarkerEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * optional bool send_word_marker_events = 2; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendWordMarkerEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendWordMarkerEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - -/** - * optional bool send_phoneme_marker_events = 3; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendPhonemeMarkerEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendPhonemeMarkerEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional bool send_bookmark_marker_events = 4; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendBookmarkMarkerEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendBookmarkMarkerEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); -}; - - -/** - * optional bool send_paragraph_marker_events = 5; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendParagraphMarkerEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendParagraphMarkerEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 5, value); -}; - - -/** - * optional bool send_visemes = 6; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendVisemes = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendVisemes = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - - -/** - * optional bool send_log_events = 7; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSendLogEvents = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSendLogEvents = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); -}; - - -/** - * optional bool suppress_input = 8; - * @return {boolean} - */ -proto.nuance.tts.v1.EventParameters.prototype.getSuppressInput = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nuance.tts.v1.EventParameters} returns this - */ -proto.nuance.tts.v1.EventParameters.prototype.setSuppressInput = function(value) { - return jspb.Message.setProto3BooleanField(this, 8, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nuance.tts.v1.SynthesisResponse.oneofGroups_ = [[1,2,3]]; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.SynthesisResponse.ResponseCase = { - RESPONSE_NOT_SET: 0, - STATUS: 1, - EVENTS: 2, - AUDIO: 3 -}; - -/** - * @return {proto.nuance.tts.v1.SynthesisResponse.ResponseCase} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getResponseCase = function() { - return /** @type {proto.nuance.tts.v1.SynthesisResponse.ResponseCase} */(jspb.Message.computeOneofCase(this, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.SynthesisResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.SynthesisResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisResponse.toObject = function(includeInstance, msg) { - var f, obj = { - status: (f = msg.getStatus()) && proto.nuance.tts.v1.Status.toObject(includeInstance, f), - events: (f = msg.getEvents()) && proto.nuance.tts.v1.Events.toObject(includeInstance, f), - audio: msg.getAudio_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.SynthesisResponse} - */ -proto.nuance.tts.v1.SynthesisResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.SynthesisResponse; - return proto.nuance.tts.v1.SynthesisResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.SynthesisResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.SynthesisResponse} - */ -proto.nuance.tts.v1.SynthesisResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Status; - reader.readMessage(value,proto.nuance.tts.v1.Status.deserializeBinaryFromReader); - msg.setStatus(value); - break; - case 2: - var value = new proto.nuance.tts.v1.Events; - reader.readMessage(value,proto.nuance.tts.v1.Events.deserializeBinaryFromReader); - msg.setEvents(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAudio(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.SynthesisResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.SynthesisResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.SynthesisResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStatus(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.Status.serializeBinaryToWriter - ); - } - f = message.getEvents(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.Events.serializeBinaryToWriter - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeBytes( - 3, - f - ); - } -}; - - -/** - * optional Status status = 1; - * @return {?proto.nuance.tts.v1.Status} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getStatus = function() { - return /** @type{?proto.nuance.tts.v1.Status} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Status, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Status|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this -*/ -proto.nuance.tts.v1.SynthesisResponse.prototype.setStatus = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.clearStatus = function() { - return this.setStatus(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.hasStatus = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Events events = 2; - * @return {?proto.nuance.tts.v1.Events} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getEvents = function() { - return /** @type{?proto.nuance.tts.v1.Events} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Events, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Events|undefined} value - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this -*/ -proto.nuance.tts.v1.SynthesisResponse.prototype.setEvents = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.clearEvents = function() { - return this.setEvents(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.hasEvents = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional bytes audio = 3; - * @return {!(string|Uint8Array)} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getAudio = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes audio = 3; - * This is a type-conversion wrapper around `getAudio()` - * @return {string} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getAudio_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAudio())); -}; - - -/** - * optional bytes audio = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAudio()` - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.getAudio_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAudio())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.setAudio = function(value) { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nuance.tts.v1.SynthesisResponse} returns this - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.clearAudio = function() { - return jspb.Message.setOneofField(this, 3, proto.nuance.tts.v1.SynthesisResponse.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.SynthesisResponse.prototype.hasAudio = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.UnarySynthesisResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.UnarySynthesisResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.UnarySynthesisResponse.toObject = function(includeInstance, msg) { - var f, obj = { - status: (f = msg.getStatus()) && proto.nuance.tts.v1.Status.toObject(includeInstance, f), - events: (f = msg.getEvents()) && proto.nuance.tts.v1.Events.toObject(includeInstance, f), - audio: msg.getAudio_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.UnarySynthesisResponse; - return proto.nuance.tts.v1.UnarySynthesisResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.UnarySynthesisResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Status; - reader.readMessage(value,proto.nuance.tts.v1.Status.deserializeBinaryFromReader); - msg.setStatus(value); - break; - case 2: - var value = new proto.nuance.tts.v1.Events; - reader.readMessage(value,proto.nuance.tts.v1.Events.deserializeBinaryFromReader); - msg.setEvents(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAudio(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.UnarySynthesisResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.UnarySynthesisResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.UnarySynthesisResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStatus(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nuance.tts.v1.Status.serializeBinaryToWriter - ); - } - f = message.getEvents(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nuance.tts.v1.Events.serializeBinaryToWriter - ); - } - f = message.getAudio_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } -}; - - -/** - * optional Status status = 1; - * @return {?proto.nuance.tts.v1.Status} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.getStatus = function() { - return /** @type{?proto.nuance.tts.v1.Status} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Status, 1)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Status|undefined} value - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} returns this -*/ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.setStatus = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} returns this - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.clearStatus = function() { - return this.setStatus(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.hasStatus = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Events events = 2; - * @return {?proto.nuance.tts.v1.Events} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.getEvents = function() { - return /** @type{?proto.nuance.tts.v1.Events} */ ( - jspb.Message.getWrapperField(this, proto.nuance.tts.v1.Events, 2)); -}; - - -/** - * @param {?proto.nuance.tts.v1.Events|undefined} value - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} returns this -*/ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.setEvents = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} returns this - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.clearEvents = function() { - return this.setEvents(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.hasEvents = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional bytes audio = 3; - * @return {!(string|Uint8Array)} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.getAudio = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes audio = 3; - * This is a type-conversion wrapper around `getAudio()` - * @return {string} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.getAudio_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAudio())); -}; - - -/** - * optional bytes audio = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAudio()` - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.getAudio_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAudio())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nuance.tts.v1.UnarySynthesisResponse} returns this - */ -proto.nuance.tts.v1.UnarySynthesisResponse.prototype.setAudio = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Status.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Status.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Status} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Status.toObject = function(includeInstance, msg) { - var f, obj = { - code: jspb.Message.getFieldWithDefault(msg, 1, 0), - message: jspb.Message.getFieldWithDefault(msg, 2, ""), - details: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Status} - */ -proto.nuance.tts.v1.Status.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Status; - return proto.nuance.tts.v1.Status.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Status} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Status} - */ -proto.nuance.tts.v1.Status.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setCode(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDetails(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Status.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Status.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Status} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Status.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCode(); - if (f !== 0) { - writer.writeUint32( - 1, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDetails(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional uint32 code = 1; - * @return {number} - */ -proto.nuance.tts.v1.Status.prototype.getCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nuance.tts.v1.Status} returns this - */ -proto.nuance.tts.v1.Status.prototype.setCode = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string message = 2; - * @return {string} - */ -proto.nuance.tts.v1.Status.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Status} returns this - */ -proto.nuance.tts.v1.Status.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string details = 3; - * @return {string} - */ -proto.nuance.tts.v1.Status.prototype.getDetails = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Status} returns this - */ -proto.nuance.tts.v1.Status.prototype.setDetails = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nuance.tts.v1.Events.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Events.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Events.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Events} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Events.toObject = function(includeInstance, msg) { - var f, obj = { - eventsList: jspb.Message.toObjectList(msg.getEventsList(), - proto.nuance.tts.v1.Event.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Events} - */ -proto.nuance.tts.v1.Events.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Events; - return proto.nuance.tts.v1.Events.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Events} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Events} - */ -proto.nuance.tts.v1.Events.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nuance.tts.v1.Event; - reader.readMessage(value,proto.nuance.tts.v1.Event.deserializeBinaryFromReader); - msg.addEvents(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Events.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Events.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Events} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Events.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getEventsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nuance.tts.v1.Event.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Event events = 1; - * @return {!Array} - */ -proto.nuance.tts.v1.Events.prototype.getEventsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nuance.tts.v1.Event, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nuance.tts.v1.Events} returns this -*/ -proto.nuance.tts.v1.Events.prototype.setEventsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nuance.tts.v1.Event=} opt_value - * @param {number=} opt_index - * @return {!proto.nuance.tts.v1.Event} - */ -proto.nuance.tts.v1.Events.prototype.addEvents = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nuance.tts.v1.Event, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nuance.tts.v1.Events} returns this - */ -proto.nuance.tts.v1.Events.prototype.clearEventsList = function() { - return this.setEventsList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.nuance.tts.v1.Event.prototype.toObject = function(opt_includeInstance) { - return proto.nuance.tts.v1.Event.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.nuance.tts.v1.Event} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Event.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - valuesMap: (f = msg.getValuesMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nuance.tts.v1.Event} - */ -proto.nuance.tts.v1.Event.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nuance.tts.v1.Event; - return proto.nuance.tts.v1.Event.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nuance.tts.v1.Event} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nuance.tts.v1.Event} - */ -proto.nuance.tts.v1.Event.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = msg.getValuesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nuance.tts.v1.Event.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nuance.tts.v1.Event.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nuance.tts.v1.Event} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nuance.tts.v1.Event.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getValuesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.nuance.tts.v1.Event.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nuance.tts.v1.Event} returns this - */ -proto.nuance.tts.v1.Event.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * map values = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nuance.tts.v1.Event.prototype.getValuesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 2, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nuance.tts.v1.Event} returns this - */ -proto.nuance.tts.v1.Event.prototype.clearValuesMap = function() { - this.getValuesMap().clear(); - return this;}; - - -/** - * @enum {number} - */ -proto.nuance.tts.v1.EnumAgeGroup = { - ADULT: 0, - CHILD: 1 -}; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.EnumGender = { - ANY: 0, - MALE: 1, - FEMALE: 2, - NEUTRAL: 3 -}; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.EnumVariableBitrate = { - VARIABLE_BITRATE_ON: 0, - VARIABLE_BITRATE_OFF: 1, - VARIABLE_BITRATE_CONSTRAINED: 2 -}; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.EnumResourceType = { - USER_DICTIONARY: 0, - TEXT_USER_RULESET: 1, - BINARY_USER_RULESET: 2, - ACTIVEPROMPT_DB: 3, - ACTIVEPROMPT_DB_AUTO: 4, - SYSTEM_DICTIONARY: 5 -}; - -/** - * @enum {number} - */ -proto.nuance.tts.v1.EnumSSMLValidationMode = { - STRICT: 0, - WARN: 1, - NONE: 2 -}; - -goog.object.extend(exports, proto.nuance.tts.v1); diff --git a/test/index.js b/test/index.js index 0bb9c22..f8bd9e0 100644 --- a/test/index.js +++ b/test/index.js @@ -3,5 +3,4 @@ require('./synth'); require('./list-voices'); require('./aws'); -require('./nuance'); require('./docker_stop'); diff --git a/test/list-voices.js b/test/list-voices.js index e47d7e6..d51ab87 100644 --- a/test/list-voices.js +++ b/test/list-voices.js @@ -12,99 +12,6 @@ const stats = { histogram: () => {} }; -test('Verbio - get Access key and voices', async(t) => { - const fn = require('..'); - const {client, getTtsVoices, getVerbioAccessToken} = fn(opts, logger); - if (!process.env.VERBIO_CLIENT_ID || !process.env.VERBIO_CLIENT_SECRET) { - t.pass('skipping Verbio test since no Verbio Keys provided'); - t.end(); - client.quit(); - return; - } - - try { - const credentials = { - client_id: process.env.VERBIO_CLIENT_ID, - client_secret: process.env.VERBIO_CLIENT_SECRET - }; - let obj = await getVerbioAccessToken(credentials); - t.ok(obj.access_token , 'successfully received access token not from cache'); - const voices = await getTtsVoices({vendor: 'verbio', credentials}); - t.ok(voices && voices.length != 0, 'successfully received verbio voices'); - } catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - -test('Nuance hosted tests', async(t) => { - const fn = require('..'); - const {client, getTtsVoices} = fn(opts, logger); - - if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET ) { - t.pass('skipping Nuance hosted test since no Nuance client_id and secret provided'); - t.end(); - client.quit(); - return; - } - try { - const opts = { - vendor: 'nuance', - credentials: { - client_id: process.env.NUANCE_CLIENT_ID, - secret: process.env.NUANCE_SECRET - } - }; - let voices = await getTtsVoices(opts); - t.ok(voices.length > 0 && voices[0].language, - `GetVoices: successfully retrieved ${voices.length} voices from Nuance`); - - await client.flushall(); - - t.end(); - - } - catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - -test('Nuance on-prem tests', async(t) => { - const fn = require('..'); - const {client, getTtsVoices} = fn(opts, logger); - - if (!process.env.NUANCE_TTS_URI ) { - t.pass('skipping Nuance on-prem test since no Nuance uri provided'); - t.end(); - client.quit(); - return; - } - try { - const opts = { - vendor: 'nuance', - credentials: { - nuance_tts_uri: process.env.NUANCE_TTS_URI - } - }; - let voices = await getTtsVoices(opts); - t.ok(voices.length > 0 && voices[0].language, - `GetVoices: successfully retrieved ${voices.length} voices from Nuance`); - - await client.flushall(); - - t.end(); - - } - catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - test('Google tests', async(t) => { const fn = require('..'); const {client, getTtsVoices} = fn(opts, logger); diff --git a/test/nuance.js b/test/nuance.js deleted file mode 100644 index 5735df9..0000000 --- a/test/nuance.js +++ /dev/null @@ -1,81 +0,0 @@ -const test = require('tape').test ; -const config = require('config'); -const opts = config.get('redis'); -const fs = require('fs'); -const logger = require('pino')({level: 'error'}); -process.on('unhandledRejection', (reason, p) => { - console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); -}); - -const stats = { - increment: () => {}, - histogram: () => {} -}; - -test('Nuance hosted tests', async(t) => { - const fn = require('..'); - const {client, getTtsVoices} = fn(opts, logger); - - if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET ) { - t.pass('skipping Nuance hosted test since no Nuance client_id and secret provided'); - t.end(); - client.quit(); - return; - } - try { - const opts = { - vendor: 'nuance', - credentials: { - client_id: process.env.NUANCE_CLIENT_ID, - secret: process.env.NUANCE_SECRET - } - }; - let voices = await getTtsVoices(opts); - t.ok(voices.length > 0 && voices[0].language, - `GetVoices: successfully retrieved ${voices.length} voices from Nuance`); - - await client.flushall(); - - t.end(); - - } - catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - -test('Nuance on-prem tests', async(t) => { - const fn = require('..'); - const {client, getTtsVoices} = fn(opts, logger); - - if (!process.env.NUANCE_TTS_URI ) { - t.pass('skipping Nuance on-prem test since no Nuance uri provided'); - t.end(); - client.quit(); - return; - } - try { - const opts = { - vendor: 'nuance', - credentials: { - nuance_tts_uri: process.env.NUANCE_TTS_URI - } - }; - let voices = await getTtsVoices(opts); - t.ok(voices.length > 0 && voices[0].language, - `GetVoices: successfully retrieved ${voices.length} voices from Nuance`); - - await client.flushall(); - - t.end(); - - } - catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - diff --git a/test/synth.js b/test/synth.js index 67fcbfe..9b2f637 100644 --- a/test/synth.js +++ b/test/synth.js @@ -759,82 +759,6 @@ test('Azure custom voice speech synth tests', async(t) => { client.quit(); }); -test('Nuance hosted speech synth tests', async(t) => { - const fn = require('..'); - const {synthAudio, client} = fn(opts, logger); - - if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET) { - t.pass('skipping Nuance speech synth tests since NUANCE_CLIENT_ID or NUANCE_SECRET not provided'); - return t.end(); - } - try { - let opts = await synthAudio(stats, { - vendor: 'nuance', - credentials: { - client_id: process.env.NUANCE_CLIENT_ID, - secret: process.env.NUANCE_SECRET, - }, - language: 'en-US', - voice: 'Evan', - text: 'This is a test. This is only a test', - }); - t.ok(!opts.servedFromCache, `successfully synthesized nuance audio to ${opts.filePath}`); - - opts = await synthAudio(stats, { - vendor: 'nuance', - credentials: { - client_id: process.env.NUANCE_CLIENT_ID, - secret: process.env.NUANCE_SECRET, - }, - language: 'en-US', - voice: 'Evan', - text: 'This is a test. This is only a test', - }); - t.ok(opts.servedFromCache, `successfully retrieved nuance audio from cache ${opts.filePath}`); - } catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - -test('Nuance on-prem speech synth tests', async(t) => { - const fn = require('..'); - const {synthAudio, client} = fn(opts, logger); - - if (!process.env.NUANCE_TTS_URI) { - t.pass('skipping Nuance on prem speech synth tests since NUANCE_TTS_URI not provided'); - return t.end(); - } - try { - let opts = await synthAudio(stats, { - vendor: 'nuance', - credentials: { - nuance_tts_uri: process.env.NUANCE_TTS_URI - }, - language: 'en-US', - voice: 'Evan', - text: 'This is a test of on-prem. This is only a test', - }); - t.ok(!opts.servedFromCache, `successfully synthesized nuance audio to ${opts.filePath}`); - - opts = await synthAudio(stats, { - vendor: 'nuance', - credentials: { - nuance_tts_uri: process.env.NUANCE_TTS_URI - }, - language: 'en-US', - voice: 'Evan', - text: 'This is a test of on-prem. This is only a test', - }); - t.ok(opts.servedFromCache, `successfully retrieved nuance audio from cache ${opts.filePath}`); - } catch (err) { - console.error(err); - t.end(err); - } - client.quit(); -}); - test('Nvidia speech synth tests', async(t) => { const fn = require('..'); const {synthAudio, client} = fn(opts, logger); @@ -975,55 +899,6 @@ test('Elevenlabs speech synth tests', async(t) => { client.quit(); }); -const testPlayHT = async(t, voice_engine) => { - const fn = require('..'); - const {synthAudio, client} = fn(opts, logger); - - if (!process.env.PLAYHT_API_KEY || !process.env.PLAYHT_USER_ID) { - t.pass('skipping PlayHT speech synth tests since PLAYHT_API_KEY or PLAYHT_USER_ID is/are not provided'); - return t.end(); - } - const text = 'Hi there and welcome to jambones! ' + Date.now(); - try { - const opts = await synthAudio(stats, { - vendor: 'playht', - credentials: { - api_key: process.env.PLAYHT_API_KEY, - user_id: process.env.PLAYHT_USER_ID, - voice_engine, - options: JSON.stringify({ - quality: 'medium', - speed: 1, - seed: 1, - temperature: 1, - emotion: 'female_happy', - voice_guidance: 3, - style_guidance: 20, - text_guidance: 1, - }) - }, - language: 'english', - voice: 's3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json', - text, - renderForCaching: true - }); - t.ok(!opts.servedFromCache, `successfully playht eleven audio to ${opts.filePath}`); - - } catch (err) { - console.error(JSON.stringify(err)); - t.end(err); - } - client.quit(); -}; - -test('PlayHT speech synth tests', async(t) => { - await testPlayHT(t, 'PlayHT2.0-turbo'); -}); - -test('PlayHT3.0 speech synth tests', async(t) => { - await testPlayHT(t, 'Play3.0'); -}); - test('Cartesia speech synth tests', async(t) => { const fn = require('..'); const {synthAudio, client} = fn(opts, logger); @@ -1215,39 +1090,6 @@ test('whisper speech synth tests', async(t) => { client.quit(); }); -test('Verbio speech synth tests', async(t) => { - const fn = require('..'); - const {synthAudio, client} = fn(opts, logger); - - if (!process.env.VERBIO_CLIENT_ID || !process.env.VERBIO_CLIENT_SECRET) { - t.pass('skipping Verbio Synthesize test since no Verbio Keys provided'); - t.end(); - client.quit(); - return; - } - - const text = 'Hi there and welcome to jambones!'; - try { - let opts = await synthAudio(stats, { - vendor: 'verbio', - credentials: { - client_id: process.env.VERBIO_CLIENT_ID, - client_secret: process.env.VERBIO_CLIENT_SECRET - }, - language: 'en-US', - voice: 'tommy_en-us', - text, - renderForCaching: true - }); - t.ok(!opts.servedFromCache, `successfully synthesized whisper audio to ${opts.filePath}`); - - } catch (err) { - console.error(JSON.stringify(err)); - t.end(err); - } - client.quit(); -}) - test('Deepgram speech synth tests', async(t) => { const fn = require('..'); const {synthAudio, client} = fn(opts, logger);