text-to-speech

Google's Text-To-Speech API from Android app

柔情痞子 提交于 2019-11-29 12:59:47
I want to use Google's Text-To-Speech API in an Android app but I only could find the way to do it from web (Chrome). This is my first attempt to play "Hello world" from the app. playTTS is the onClick and it is been executed, but no sound is played. Is there any JS/Java library I need to import? Is it possible to generate an audio file from it? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myBrowser = new WebView(this); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction()

Android Text To Speech And Numbers

我的梦境 提交于 2019-11-29 11:39:24
I am using Android Text to Speech engine for reading some text and it's working. But my text contains numbers and I want the numbers to be read digit by digit. I couldn't find anything in the documentation, but I am still hoping someone knows how I can do that. The API does not allow you to specify how the text should be read so your code has to modify the text input so that it reads the individual numbers. I suggest adding a space in between each number. That should cause the TextToSpeech to read the individual numbers. If you need some code to help you detect numbers use this: private

Is it possible to use TTS in iOS

谁说胖子不能爱 提交于 2019-11-29 10:18:56
问题 Does anyone know if it is possible to implement TTS in iOS development like in Android? Is it in a library or something? I believe I heard something about utility and TTS in iOS but I have had difficulty finding any documentation on this matter. Any help would be appreciated. 回答1: flite TTS has been turned into an iOS library available here. It is not too hard to implement. Be aware that the performance that you see in the simulator is way better than on a device and you will need to budget

onUtteranceCompleted does not get called?

99封情书 提交于 2019-11-29 09:48:56
Even though I am setting it correctly: HashMap<String, String> myHashRender = new HashMap<String, String>(); myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "utid"); mTts.speak("Speak something", TextToSpeech.QUEUE_ADD, myHashRender); also mTts.setOnUtteranceCompletedListener(this); in the onInit function return success. Still the onUtteranceCompleted does not get called. Though there are duplicate questions, but no where I could find the answer. My Activity also implements OnUtteranceCompletedListener. Please help. Call the setOnUtteranceCompletedListener inside the onInit

TTS to Stream with SpeechAudioFormatInfo using SpeechSynthesizer

我是研究僧i 提交于 2019-11-29 09:27:40
问题 I am using System.Speech.Synthesis.SpeechSynthesizer to convert text to speech. And due to Microsoft's anemic documentation (see my link, there's no remarks or code examples) I'm having trouble making heads or tails of the difference between two methods: SetOutputToAudioStream and SetOutputToWaveStream. Here's what I have deduced: SetOutputToAudioStream takes a stream and a SpeechAudioFormatInfo instance that defines the format of the wave file (samples per second, bits per second, audio

Delphi SAPI Text-To-Speech

只谈情不闲聊 提交于 2019-11-29 08:21:51
问题 First of all: this is not a duplicate of Delphi and SAPI. I have a specific problem with the "SAPI in Delphi" subject. I have used the excellent Import Type-Library guide in Delphi 2009 to get a TSpVoice component in the component palette. This works great. With var SpVoice: TSpVoice; I can write SpVoice.Speak('This is an example.', 1); to get asynchronous audio output. First question According to the documentation, I would be able to write SpVoice.Speak('This is an example.', 0); to get

How to install and use additional voices in SpeechSynthesizer()?

心不动则不痛 提交于 2019-11-29 07:57:31
I need to use male voice in SpeechSynthesizer in addition to default Anna voice. I installed some files from Microsoft, and GetInstalledVoices() method says now I have Microsoft Anna, Microsoft Mary, Microsoft Mike and Sample TTS Voice. After I'm trying to set voice speaker.SelectVoice("Microsoft Mike"); my program throws exception: Cannot set voice. No matching voice is installed or the voice was disabled. What should I exactly install and how to enable Mike's voice? System is Windows7. Dork After trying many suggestions from web found working solution: - install Microsoft Speech Platform SDK

Android Text To Speech Male Voice

大兔子大兔子 提交于 2019-11-29 07:41:08
I have a working text to speech but I was wondering instead of a female voice when the app calls it to be played it will do a male voice instead? It is now possible to use male/female voice and change it from App UI dynamically. Define TTS like this (add google tts engine in constructor): tts = new TextToSpeech(context, this, "com.google.android.tts"); contex = activity/app this= TextToSpeech.OnInitListener From tts.getVoices() list, chose your desired voice by it's name like this: for (Voice tmpVoice : tts.getVoices()) { if (tmpVoice.getName().equals(_voiceName)) { return tmpVoice; break; } }

How do I play audio returned from an XMLHTTPRequest using the HTML5 Audio API

泪湿孤枕 提交于 2019-11-29 07:24:20
I'm failing to be able to play audio when making an "AJAX" request to my server side api. I have backend Node.js code that's using IBM's Watson Text-to-Speech service to serve audio from text: var render = function(request, response) { var options = { text: request.params.text, voice: 'VoiceEnUsMichael', accept: 'audio/ogg; codecs=opus' }; synthesizeAndRender(options, request, response); }; var synthesizeAndRender = function(options, request, response) { var synthesizedSpeech = textToSpeech.synthesize(options); synthesizedSpeech.on('response', function(eventResponse) { if(request.params.text

Recording synthesized text-to-speech to a file in Python

北城余情 提交于 2019-11-29 04:30:11
I am attempting to find a way to take synthesized speech and record it to an audio file. I am currently using pyttsx as my text-to-speech library, but there isn't a mechanism for saving the output to a file, only playing it directly from the speakers. I've looked into detecting and recording audio as well as PyAudio , but these seem to take input from a microphone rather than redirecting outgoing audio to a file. Is there a known way to do this? dtrujillo You can call espeak with the -w argument using subprocess . import subprocess def textToWav(text,file_name): subprocess.call(["espeak", "-w"