Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import android.app.Service;
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;
@Override
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) {
speak("はいはい、バレンタインなんてもういいですから");
} else if (status == TextToSpeech.ERROR) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment