text-to-speech

How to save the output of PyTTSx to wav file

…衆ロ難τιáo~ 提交于 2019-12-02 02:17:49
问题 I'm trying to find a solution why my code doesn't work properly. I used solution from Recording synthesized text-to-speech to a file in Python, and it kinda didnt worked out for me. The question is why 2 methods/functions text_to_wav and all_texts_to_files doesnt work for me. import json import pyttsx from openpyxl import load_workbook import subprocess class Ver2ProjectWithTTS(object): def __init__(self): self.list_merge = [] def do_the_job(self): self.read_json_file() self.read_xml_file()

Convert Toast message to text

别来无恙 提交于 2019-12-02 01:29:17
How can I convert this TOAST message to voice in Android? Example Toast.makeText(MainActivity.this, "I am enter code here" +positive[+ position]+ " always", Toast.LENGTH_SHORT).show(); First import the package import android.speech.tts.TextToSpeech; Then initialize private TextToSpeech tts; tts = new TextToSpeech(this, this); Finally make a function like this private void speakOut() { String text = txtText.getText().toString(); tts.speak(text, TextToSpeech.QUEUE_FLUSH, null); } Woops. I forgot, you'll also need to define an onInit function public void onInit(int status) { if (status ==

How to save the output of PyTTSx to wav file

和自甴很熟 提交于 2019-12-02 01:11:45
I'm trying to find a solution why my code doesn't work properly. I used solution from Recording synthesized text-to-speech to a file in Python , and it kinda didnt worked out for me. The question is why 2 methods/functions text_to_wav and all_texts_to_files doesnt work for me. import json import pyttsx from openpyxl import load_workbook import subprocess class Ver2ProjectWithTTS(object): def __init__(self): self.list_merge = [] def do_the_job(self): self.read_json_file() self.read_xml_file() #self.say_something() self.all_texts_to_files() def read_json_file(self): with open("json-example.json"

Text to speech returns a different non-existant Locale after setting an existing one

夙愿已清 提交于 2019-12-01 22:57:46
original question I have a standard texttospeech, android.speech.tts.TextToSpeech I initialize it and set a language by using tts.setLanguage(Locale.getDefault()) That default Locale is de_DE (for germany, correct). Right after setting it, i ask the tts to give me its language tts.getLanguage() now it tells me that its set to "deu_DEU" There is no Locale with that setting. So i cant even check if its set to the right language because i cant find the Locale object that has the matching values. Issue might be related to Android 4.3, but i didnt find any info. Background is, that i need to show

Global TTS in Android

故事扮演 提交于 2019-12-01 22:38:04
Hi I am devloping an application for blind users so that I use very often text to speech as practicaly the only one method how to respond on user actions. I decided to make one global TTS instance running as long as the app. I have implemented it this way package com.simekadam.blindguardian; import android.content.Context; import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; public class SpeechHelper implements OnInitListener { private static TextToSpeech mTts; private String text; private static final SpeechHelper helper = new SpeechHelper(); public

Text to Speech in ASP.NET - Access is denied… what to do?

白昼怎懂夜的黑 提交于 2019-12-01 21:58:51
On my personal website, i would like to make it "pronounce" something I solved the "concept" problem, as in here , and on my desktop it works smoothly when launched from visual web developer. Creates a file, and then an embedded player in the page will play it. Perfect. So, I uploaded it on the server... I get this error 500: Server Error in '/sapi' Application. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error

SpeechSynthesis in Android-Chrome: cannot change English voice from US English

我们两清 提交于 2019-12-01 21:12:42
I'm using the speech synthesis API on Android-Chrome. The issue is that although there are 4 English voices available, it is always US English that is used by the browser, no matter what the code specifies. I can use other languages e.g. French, just not other English voices e.g en-AU, GB, or IN. This code filters British English voice objects from the getVoices array and uses the first to utter the word 'tomato'. The problem is that the word is always pronounced "to-may-lo" not "to-mar-to" which means my text doesn't rhyme as it should. The voice object that was used is displayed and (on the

set turkish language for text to speech [duplicate]

China☆狼群 提交于 2019-12-01 19:45:21
This question already has an answer here: Using text to speech APIs in android application 3 answers Im working on text to speech app , i want to set turkish language to be as this: tts.setLanguage(Locale.TR); BUT this is not available in android , is it wrong to add this way or there is different way to add turkish language to text to speech . any help and advice will be appreciated text to speech code : public class AndroidTextToSpeechActivity extends Activity implements TextToSpeech.OnInitListener { /** Called when the activity is first created. */ private TextToSpeech tts; private Button

getSpeechRate()? (or how to tell what rate TTS is currently set at)

徘徊边缘 提交于 2019-12-01 19:36:49
TextToSpeech has a way to set the speech rate: setSpeechRate() . But it doesn't have an opposite method of querying the current speed. Is there a way to query the system for that value? You may get default TTS speech rate Settings.Secure.getInt(getContentResolver(), Settings.Secure.TTS_DEFAULT_RATE, 100) / 100f; I was looking for similar thing and it seems like there really isn't such a method. But since 1.0 is the normal speech rate , I solved it by keeping the rate in my own variable. I have a class that provides few methods to work with TTS, so here's my implementation: public class MyTts {

How to wait for TextToSpeech initialization on Android

旧巷老猫 提交于 2019-12-01 18:55:11
I am writing an activity that speaks to the user and I'd really like to block on TextToSpeech initialization - or else time out. How can I get my thread to wait? I tried: while (! mIsTtsReady || i>limit) try { Thread.sleep(100); i++; ... }; along with: @Override public void OnInit() { mIsTtsReady = true; } // TextToSpeech.OnInitListener But OnInit() never runs. It seems that OnInit executes within my thread (via a message to my activities Looper?), which is in a tight sleep() loop. It seems wrong to put the bulk of my code (the "after init" stuff) into OnInit itself. Moving it into a Runnable,