'Android/Text To Speech (TTS)'에 해당되는 글 1건

  1. 2013.07.25 Android TTS (Text To Speech) 기본 예제
2013.07.25 16:30
public class Text2SpeechTest extends Activity implementsOnInitListener {
02 
03   TextToSpeech talker;
04 
05    @Override
06    public void onCreate(Bundle savedInstanceState) {
07        super.onCreate(savedInstanceState);
08        setContentView(R.layout.main);
09        talker = new TextToSpeech(thisthis);
10    }
11 
12    public void say(String text2say){
13      talker.speak(text2say, TextToSpeech.QUEUE_FLUSH,null);
14    }
15 
16   @Override
17   public void onInit(int status) {
18      say("Hello World");
19 
20   }
21 
22   @Override
23   public void onDestroy() {
24      if (talker != null) {
25         talker.stop();
26         talker.shutdown();
27      }
28 
29      super.onDestroy();
30   }
31}




신고

'Android > Text To Speech (TTS)' 카테고리의 다른 글

Android TTS (Text To Speech) 기본 예제  (0) 2013.07.25
Posted by hoonihoon85 hoonihoon

티스토리 툴바