1

子供向けの新しいアプリケーションを作成しています。このアプリケーションは、子供たちがアルファベットを学ぶためのものです。

これで、 GridView を使用してアルファベットが表示されるメイン画面が作成されました。今私が欲しいのは、特定のアルファベットをクリックすると、その画面の次の画面に移動し、線を使用してアルファベットを描画し、(Apple の場合は「A」) のような声を追加する必要があることです。

それを行う方法を知っている人はいますか?助けてください...

前もって感謝します...

4

1 に答える 1

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!");    
于 2012-10-18T08:35:13.417 に答える