2012-10-18 39 views
1

我正在爲孩子們創建一個新的應用程序。這個應用程序是爲孩子們學習字母。如何在應用程序中創建語音活動?

現在我創建了一個主屏幕,其中使用GridView顯示字母表。現在我想要的是,當點擊特定字母時,它應該進入該屏幕中的下一個屏幕,它應該使用線條繪製字母表,然後像蘋果公司的'A'這樣的聲音應該被添加?

是任何身體知道該怎麼做,那麼請幫我...

在此先感謝...

回答

1

試試這個:

TextToSpeech mTextToSpeech = new TextToSpeech(this,new TextToSpeech.OnInitListener() 
{ 
    @Override 
    public void onInit(int status) 
    { 
    // TODO Auto-generated method stub 
    if(status == TextToSpeech.SUCCESS) 
    { 
     // set language 
     int supported = mTextToSpeech.setLanguage(Locale.US); 
     if((supported != TextToSpeech.LANG_AVAILABLE)&&(supported != TextToSpeech.LANG_COUNTRY_AVAILABLE)) 
     { 
     displayToast("dont support current language"); 
     } 
    } 
    } 
}); 

// start to speak 
mTextToSpeech.speak("A for Apple", TextToSpeech.QUEUE_FLUSH, null); 

// store your voice to file 
int r = mTextToSpeech.synthesizeToFile(mEditText.getText().toString(), null, "/mnt/sdcard/speak.wav"); 
if(r == TextToSpeech.SUCCESS) displayToast("save success!");  
相關問題