Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import android.content.Intent;
import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.widget.Toast;
public class TTS extends Service implements TextToSpeech.OnInitListener {
public static TextToSpeech mTts;
public IBinder onBind(Intent intent) {
return null;
public void onStart(Intent intent, int startId) {
mTts = new TextToSpeech(this, this);
super.onStart(intent, startId);
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
} else if (status == TextToSpeech.ERROR) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment