Note that there are some explanatory texts on larger screens.

plurals
  1. POissue with tts in android (service isn't started)
    primarykey
    data
    text
    <p>I am beginner in android and I have an issue with tts in android, eclipse writes in log: </p> <blockquote> <p>10-04 15:27:49.851: ERROR/TextToSpeech.java - speak(19515): service isn't started</p> </blockquote> <p>There is my code, all from example:</p> <pre><code>package ru.andr.dictu; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.speech.tts.TextToSpeech; import android.view.View; /** * This class demonstrates checking for a TTS engine, and if one is * available it will spit out some speak based on what is in the * text field. */ public class speak extends Activity implements TextToSpeech.OnInitListener { public static String text = "some text"; private TextToSpeech mTts; // This code can be any value you want, its just a checksum. private static final int MY_DATA_CHECK_CODE = 1234; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.speech); // Fire off an intent to check if a TTS engine is installed Intent checkIntent = new Intent(); checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); startActivityForResult(checkIntent, MY_DATA_CHECK_CODE); } public void speakClicked(View v) { } public void onInit(int i) { } public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == MY_DATA_CHECK_CODE) { if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) { // success, create the TTS instance mTts = new TextToSpeech(this, this); //try to speak LetsSpeak(); } else { // missing data, install it Intent installIntent = new Intent(); installIntent.setAction( TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA); startActivity(installIntent); } } } @Override public void onDestroy() { // Don't forget to shutdown! if (mTts != null) { mTts.stop(); mTts.shutdown(); } super.onDestroy(); } public void LetsSpeak() { // TODO Auto-generated method stub mTts.speak(text, TextToSpeech.QUEUE_FLUSH, // Drop all pending entries in the playback queue. null); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload