google-text-to-speech

How to free resource in PyGame mixer?

微笑、不失礼 提交于 2019-12-07 01:57:21
I use gTTS python module to get mp3 from Google Text-To-Speech API and PyGame to play output mp3 files without opening external player (is there any simpler way to do it?) However it seems like PyGame mixer doesn't free file resource, even after it's quit method. phrase = "Hello!" tts = gtts.gTTS(text=phrase, lang='en') tts.save("googleTTS.mp3") f = MP3("googleTTS.mp3") mixer.init(f.info.sample_rate) mixer.music.load("googleTTS.mp3") mixer.music.play() while mixer.music.get_busy() == True: continue mixer.quit() # doesn't free resource? phrase = "Bye!" tts = gtts.gTTS(text=phrase, lang='en')

Google Cloud Text-to-Speech Interface Confusion (How do I download the mp3 files?)

坚强是说给别人听的谎言 提交于 2019-12-06 11:34:27
I'd like to preface this with the fact that I am not a programmer/developer - I am a multimedia designer. I use text-to-speech to generate placeholder audio files that can be used to time animations before we record the official audio narration. Previously I was using Amazon Polly but I wanted to give Google Cloud a try. However, I'm having the hardest time actually figuring out how to generate the mp3 files and save them. With Amazon Polly, you simply go to a website, enter your text into a field, and click a button and it will save your file as an mp3 file. With Google Cloud, it seems far

In Android----How can we provide hint which word is speaking in Text to Speech?

回眸只為那壹抹淺笑 提交于 2019-12-06 09:28:59
Any body help me to Provide hint in Text to Speech? I get word in Array but TextToSpeech.QUEUE_ADD takes a few seconds to speak and makes bold word run speedily. My Code is below :-(tts is a TextToSpeech object) String[] strArr = txtText.getText().toString().split(" "); txtText.setText(""); for(int i=0;i<strArr.length;i++) { Log.d("","Value :- "+strArr[i]); HashMap<String, String> myHashAlarm = new HashMap<String, String>(); myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_NOTIFICATION)); myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "test"

Save an audiofile from Google Text-to-Speech to Firebase Storage using Google Cloud Storage?

本小妞迷上赌 提交于 2019-12-06 08:26:23
We're trying to get an audiofile from Google Text-to-Speech and save it to Firebase Storage, using a Google Cloud Function. The documentation for Google Text-to-Speech show how to get an audiofile and save it locally: // Performs the Text-to-Speech request const [response] = await client.synthesizeSpeech(request); // Write the binary audio content to a local file const writeFile = util.promisify(fs.writeFile); await writeFile('output.mp3', response.audioContent, 'binary'); console.log('Audio content written to file: output.mp3'); This results in an error message Error: EROFS: read-only file

Text to speech not working on android device

天大地大妈咪最大 提交于 2019-12-05 19:33:52
Below is my code.I am unable to hear the voice in my kitkat device.Toast is appearing but voice is not playing.I am following this tutorial https://www.tutorialspoint.com/android/android_text_to_speech.htm package com.example.insert; import android.os.Parcelable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.app.Activity; import android.os.Bundle; import android.speech.tts.TextToSpeech; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.util.Locale; import android.widget.Toast; import android.util.Log;

TextToSpeech and memory leak

陌路散爱 提交于 2019-12-05 13:10:42
I've been having app crashes due to an out-of-memory condition (in the program, not the programmer). MAT shows that copies of my Activity were sometimes being retained across screen rotations, and the only object keeping the bogus copies alive was each instance's TextToSpeech object. I can duplicate this behaviour using this snippet: public class MainActivity extends Activity { TextToSpeech mTts; char[] mBigChunk = new char[1000000]; // not used; just makes MainActivity instances easier to see in MAT @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

How to use gTTS in python?

本秂侑毒 提交于 2019-12-04 06:02:14
问题 When executing the below code from gtts import gTTS tts = gTTS('hello') tts.save('hello.mp3') I am getting "AttributeError: 'NoneType' object has no attribute 'group'". Traceback (most recent call last): File "C:\Users\HP\Desktop\Desktop\programming\Python_code\New Text Document - Copy (8) - Copy.py", line 3, in <module> tts.save('hello.mp3') File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\gtts\tts.py", line 247, in save self.write_to_fp(f) File "C:\Users\HP\AppData

SpeechSynthesis API onend callback not working

梦想的初衷 提交于 2019-12-03 03:58:52
问题 I'm using the Speech Synthesis API on Google Chrome v34.0.1847.131. The API is implemented in Chrome starting in v33. The text-to-speech works for the most part, except when assigning a callback to onend . For instance, the following code: var message = window.SpeechSynthesisUtterance("Hello world!"); message.onend = function(event) { console.log('Finished in ' + event.elapsedTime + ' seconds.'); }; window.speechSynthesis.speak(message); will sometimes call onend and sometimes not call it.

SpeechSynthesis API onend callback not working

こ雲淡風輕ζ 提交于 2019-12-02 16:16:57
I'm using the Speech Synthesis API on Google Chrome v34.0.1847.131. The API is implemented in Chrome starting in v33. The text-to-speech works for the most part, except when assigning a callback to onend . For instance, the following code: var message = window.SpeechSynthesisUtterance("Hello world!"); message.onend = function(event) { console.log('Finished in ' + event.elapsedTime + ' seconds.'); }; window.speechSynthesis.speak(message); will sometimes call onend and sometimes not call it. The timing appears to be completely off. When it does get called, the printed elapsedTime is always some