meSpeak.js (speak.js 增强版) 是一个 100% 纯客户端 JavaScript 实现的 TTS 库,基于 speak.js 开发,在其基础上增加对 Webkit 和 Safari 浏览器的支持,引入了可加载的语音模块。
使用方法:
meSpeak.loadConfig("mespeak_config.json"); meSpeak.loadVoice('en-us.json'); meSpeak.speak('hello world'); meSpeak.speak('hello world', { option1: value1, option2: value2 .. }); meSpeak.speak('hello world', { option1: value1, option2: value2 .. }, myCallback); var id = meSpeak.speak('hello world'); meSpeak.stop(id); meSpeak.speak( text [, { option1: value1, option2: value2 .. } [, callback ]] ); text: The string of text to be spoken. The text may contain line-breaks ("\n") and special characters. Default text-encoding is UTF-8 (see the option "utf16" for other). options (eSpeak command-options): * amplitude: How loud the voice will be (default: 100) * pitch: The voice pitch (default: 50) * speed: The speed at which to talk (words per minute) (default: 175) * voice: Which voice to use (default: last voice loaded or defaultVoice, see below) * wordgap: Additional gap between words in 10 ms units (default: 0) * variant: One of the variants to be found in the eSpeak-directory "~/espeak-data/voices/!v" Variants add some effects to the normally plain voice, e.g. notably a female tone. Valid values are: "f1", "f2", "f3", "f4", "f5" for female voices "m1", "m2", "m3", "m4", "m5", "m6, "m7" for male voices "croak", "klatt", "klatt2", "klatt3", "whisper", "whisperf" for other effects. (Using eSpeak, these would be appended to the "-v" option by "+" and the value.) Note: Try "f2" or "f5" for a female voice. * linebreak: (Number) Line-break length, default value: 0. * capitals: (Number) Indicate words which begin with capital letters. 1: Use a click sound to indicate when a word starts with a capital letter, or double click if word is all capitals. 2: Speak the word "capital" before a word which begins with a capital letter. Other values: Increases the pitch for words which begin with a capital letter. The greater the value, the greater the increase in pitch. (eg.: 20) * punct: (Boolean or String) Speaks the names of punctuation characters when they are encountered in the text. If a string of characters is supplied, then only those listed punctuation characters are spoken, eg. { "punct": ".,;?" }. * nostop: (Boolean) Removes the end-of-sentence pause which normally occurs at the end of the text. * utf16: (Boolean) Indicates that the input is UTF-16, default: UTF-8. * ssml: (Boolean) Indicates that the text contains SSML (Speech Synthesis Markup Language) tags or other XML tags. (A small set of HTML is supported too.) further options (meSpeak.js specific): * volume: Volume relative to the global volume (number, 0..1, default: 1) Note: the relative volume has no effect on the export using option 'rawdata'. * rawdata: Do not play, return data only. The type of the returned data is derived from the value (case-insensitive) of 'rawdata': - 'base64': returns a base64-encoded string. - 'mime': returns a base64-encoded data-url (including the MIME-header). (synonyms: 'data-url', 'data-uri', 'dataurl', 'datauri') - 'array': returns a plain Array object with uint 8 bit data. - default (any other value): returns the generated wav-file as an ArrayBuffer (8-bit unsigned). Note: The value of 'rawdata' must evaluate to boolean 'true' in order to be recognized. * log: (Boolean) Logs the compiled eSpeak-command to the JS-console. callback: An optional callback function to be called after the sound output ended. The callback will be called with a single boolean argument indicating success. If the resulting sound is stopped by meSpeak.stop(), the success-flag will be set to false. Returns: * if called with option rawdata: a stream in the requested format (or null, if the required resources have not loaded yet). * default: a 32bit integer ID greater than 0 (or 0 on failure). The ID may be used to stop this sound by calling meSpeak.stop(<id>). if (meSpeak.isVoiceLoaded('de')) meSpeak.setDefaultVoice('de'); // note: the default voice is always the the last voice loaded meSpeak.loadVoice('fr.json', userCallback); // userCallback is an optional callback-handler. The callback will receive two arguments: // * a boolean flag for success // * either the id of the voice, or a reason for errors ('network error', 'data error', 'file error') alert(meSpeak.getDefaultVoice()); // 'fr' if (meSpeak.isConfigLoaded()) meSpeak.speak('Configuration data has been loaded.'); // note: any calls to speak() will be deferred, if no valid config-data has been loaded yet. meSpeak.setVolume(0.5); meSpeak.setVolume( volume [, id-list] ); Sets a volume level (0 <= v <= 1) * if called with a single argument, the method sets the global playback-volume, any sounds currently playing will be updated immediately with respect to their relative volume (if specified). * if called with more than a single argument, the method will set and adjust the relative volume of the sound(s) with corresponding ID(s). Returns: the volume provided. alert(meSpeak.getVolume()); // 0.5 meSpeak.getVolume( [id] ); Returns a volume level (0 <= v <= 1) * if called without an argument, the method returns the global playback-volume. * if called with an argument, the method will return the relative volume of the sound with the ID corresponding to the first argument. if no sound with a corresponding ID is found, the method will return 'undefined'. var browserCanPlayWavFiles = meSpeak.canPlay(); // test for compatibility // export speech-data as a stream (no playback): var myUint8Array = meSpeak.speak('hello world', { 'rawdata': true }); // typed array var base64String = meSpeak.speak('hello world', { 'rawdata': 'base64' }); var myDataUrl = meSpeak.speak('hello world', { 'rawdata': 'data-url' }); var myArray = meSpeak.speak('hello world', { 'rawdata': 'array' }); // simple array // playing cached streams (any of the export formats): meSpeak.play( stream [, relativeVolume [, callback]] ); var stream1 = meSpeak.speak('hello world', { 'rawdata': true }); var stream2 = meSpeak.speak('hello again', { 'rawdata': true }); var stream3 = meSpeak.speak('hello yet again', { 'rawdata': 'data-url' }); meSpeak.play(stream1); // using global volume meSpeak.play(stream2, 0.75); // 75% of global volume meSpeak.play(stream3); // v.1.4.2: play data-urls or base64-encoded var id = meSpeak.play(stream1); meSpeak.stop(id); Arguments: stream: A stream in any of the formats returned by meSpeak.play() with the "rawdata"-option. volume: (optional) Volume relative to the global volume (number, 0..1, default: 1) callback: (optional) A callback function to be called after the sound output ended. The callback will be called with a single boolean argument indicating success. If the sound is stopped by meSpeak.stop(), the success-flag will be set to false. (See also: meSpeak.speak().) Returns: A 32bit integer ID greater than 0 (or 0 on failure). The ID may be used to stop this sound by calling meSpeak.stop(<id>). meSpeak.stop( [<id-list>] ); Stops the sound(s) specified by the id-list. If called without an argument, all sounds currently playing, processed, or queued are stopped. Any callback(s) associated to the sound(s) will return false as the success-flag. Arguments: id-list: Any number of IDs returned by a call to meSpeak.speak() or meSpeak.play(). Returns: The number (integer) of sounds actually stopped.
Coqui TTS 是一个用于高级文本到语音生成的库。它建立在最新研究的基础上,旨在实现易于训练、速度和质量之间的最佳平衡。Coqui TTS 带有预训练模型、用于测量数据集质量的工具,并且已经在 20 多种语言中用于产品和研究项目。 特征: 用于 Text2Speech 任务的高性能深度学习模型 快速高效的模型训练 终端和 Tensorboard 上的详细训练日志 支持多扬声器 TTS 高效、灵
这是 iPhone 上实现 TTS 功能的开发包,基于 CMU's Festival Lite —— FLite 引擎开发。
Audible TTS可以通过发声的方式从其他应用程序,剪贴板,或从文本文件读取文本内容。它可以从应用程序如Feedme或k9-Mail,剪贴板(使用复制和粘贴),或者MicroSD卡上的文件获取文本。它还可以在混合文本中使用适当的语言和声音读取每个句子,而不必手动选择它。您必须已经安装了一个语音合成器(如微微或SVOX)和声音要使用的语言。目前支持德语、英语、西班牙语、法语、意大利语、俄罗斯、韩国、中国和日本。
Acapela TTS 是一个为 iPhone 和 iPad 开发的 TTS 引擎。
发送 TTS,就是 发送一条 能让设备立即说的 内容。 流程 接口 参数说明 字段 类型 必须? 说明 device String 是 需要发送的设备 tts String 是 让设备说的话 示例代码: Swift: RokidMobileSDK.vui.sendTts(tts: String, to device: RKDevice) Objc: [RokidMobileSDK.vui sen
流程 发送TTS 发送 TTS,就是 发送一条 能让设备立即说的 内容。 参数说明 字段 类型 必须? 说明 deviceId String 是 设备Id tts String 是 让设备说的话 示例代码: Java: RokidMobileSDK.vui.sendTts(deviceId, tts, new IChannelPublishCallback() { @Override
我正在使用一个简单的代码来使用文本到语音: 我得到的信息是: W/TextToSpeech:speak失败:未绑定到TTS引擎 我不知道我做错了什么。如果你知道答案或有任何关于它可能是什么的建议,请让我知道!
在线语音合成(tts) 概述 该API将文本转换为语音文件,支持不同编码格式和采样率. 调用示例 curl -sSL -v -X POST "https://ai.nationalchip.com/api/v1/tts" -H "accept: */*" -H "Authorization: Bearer ${access_token}" -H "Content-Type: applicatio