text-to-speech

How can I allow the TTS to write files to my app's directories?

会有一股神秘感。 提交于 2019-12-30 11:00:24
问题 I want to write output from the TextToSpeech engine to my app's cache directory. In order to for the TTS to write there I first have to give it permissions to do so. But I don't know how. I understand that normally such problems can be solved by handing a FileDescriptor over thus giving permissions to access a specific file. But I can't do that with TTS, as the TextToSpeech.synthesizeToFile method only accepts the file path as a String, no FileDescriptor . So what to do? To make my point that

How to convert text to speech in python 3.5 on windows 10?

假装没事ソ 提交于 2019-12-30 10:34:30
问题 I tried espeak but didn't succeed and some functionalities only supported in python 2. 回答1: Have you tried using gTTS? The syntax for using it in Python 3.x is as follows: from gtts import gTTS my_tts = "Text you want to process" tts = gTTS(text=my_tts, lang='en') tts.save("Absolute/path/to/file.mp3") Here is the github repo of gTTS. 回答2: For offline use: Direct use SAPI [Windows] Following code will help for demo... import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice")

Android speech - how can you read text in Android?

冷暖自知 提交于 2019-12-30 07:23:44
问题 How can you read data, i.e. convert simple text strings to voice (speech) in Android? Is there an API where I can do something like this: TextToVoice speaker = new TextToVoice(); speaker.Speak("Hello World"); 回答1: Here you go . A tutorial on using the library The big downside is that it requires an SD card to store the voices. 回答2: Using the TTS is a little bit more complicated than you expect, but it's easy to write a wrapper that gives you the API you desire. There are a number of issues

speak with TTS such as Hindi

早过忘川 提交于 2019-12-30 06:32:50
问题 In my application , I wish to know if there is any tts engine that can read hindi text . my code tts.setLanguage(Locale.US); unfortunately Hindi is not supported by Android. See the list of Locales supported below http://developer.android.com/reference/java/util/Locale.html How will i do the hindi locale any help ? Thanks in advance 回答1: Hindi is supported by Android -- it is just that there isn't a Locale constant for it. If you look at http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes,

Text To Speech app UI is slow android

亡梦爱人 提交于 2019-12-30 06:26:27
问题 In my app I am using TTS. I have 20 different activities which are changed when the user swipe left or right. According the activity, a text is spoken. I am executing tts with separate thread and activity selection is done with main thread. But the problem is very slow, the UI feels slugish. When I swipe left or right, once tts is finished speaking the text, the activity changes which shouldn't happen because I am using separate thread for tts. Here is the codE: TTS class: public class

Start Android TTS from Broadcast Receiver or Service

二次信任 提交于 2019-12-30 05:30:08
问题 I'm trying to get TTS to run in the background. But, I never get any sound. I have a broadcast receiver which starts a service. I put my TTS code in both of those, but it never speaks. I know the method is being called (I put a breakpoint on it), but it still doesn't work. Here's my log, but it doesn't seem to contain anything about the TTS service. 10-04 22:45:30.663: WARN/InputManagerService(209): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient

How can I save TTS output in an audio file on android?

拟墨画扇 提交于 2019-12-30 05:18:05
问题 this is my first post here. I'm new in Android Programming. I want to create an app where I can save the output of the text to speech into an audio file to my database. I've heard about synthesizeToFile() but It's not it. 回答1: Use this code and get the mp3 file acess from the assets folder and try this code. mMediaPlayer = new MediaPlayer(); mMediaPlayer = MediaPlayer.create(this,R.raw.button); mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mMediaPlayer.start(); mMediaPlayer

How to set volume for text-to-speech “speak” method?

那年仲夏 提交于 2019-12-30 00:40:10
问题 I'm at a lost. I want to be able to adjust the speak volume. Whatever I do, I can't increase its volume. How do I make it as loud as that found in the Android settings (as below)? System Settings -> Voice input and output -> Text-to-Speech settings -> Listen to an example My code at this moment is: AudioManager mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); mAudioManager.setSpeakerphoneOn(true); int loudmax = mAudioManager.getStreamMaxVolume(AudioManager.STREAM

How to save SAPI text to speech to an audio file in VBScript?

旧巷老猫 提交于 2019-12-29 09:16:06
问题 I have the following VBScript code for text to speech conversion: Set objVoice = CreateObject("SAPI.SpVoice") objVoice.Speak Inputbox("Enter Text") I want to save the speech to an audio file. How can I do this? 回答1: You can save the SAPI output to a .WAV file as follows: Create and open a .WAV file as a stream using the SpFileStream.Open method. Assign this file stream to the SpVoice.AudioStream property. Here's an example: Const SAFT48kHz16BitStereo = 39 Const SSFMCreateForWrite = 3 '

Japanese TTS on Android

青春壹個敷衍的年華 提交于 2019-12-29 08:55:19
问题 I'm interested in performing Japanese speech synthesis on Android. The guide on Android TTS says: "The TTS engine that ships with the Android platform supports a number of languages: English, French, German, Italian and Spanish." Yet I see an app that does Japanese TTS, and the APK is around 1 MB - not nearly enough for a standalone TTS library. So the question is: does Android TTS support Japanese in principle (e. g. as downloadable resources)? What about Japanese phones? 回答1: Found three