Created
February 13, 2016 00:46
-
-
Save happasuke/26bdcb5964e837597ca6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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