0

我想要我的 TTS 引擎语音中文,我还实现了一些代码。但不能说出我的设备中文单词。在下面查看我的代码

我已经通过了这个字符串...
您好,我是</p>

私人无效发言(字符串字){

    int result = tts.setLanguage(Locale.SIMPLIFIED_CHINESE);
     if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) 
    {
        Log.e("TTS", "Language is not supported");
    } 
    else 
    {

    }

    //Toast.makeText(ctx, text+"", Toast.LENGTH_SHORT).show();
    tts.speak(word.toString(), TextToSpeech.QUEUE_FLUSH, null);
}

@Override
public void onInit(int status)
{
    if (status == TextToSpeech.SUCCESS)
    {
        int result = tts.setLanguage(Locale.SIMPLIFIED_CHINESE);
        if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) 
        {
            Log.e("TTS", "Language is not supported");
        } 
        else 
        {
        }
        tts.speak("Nín hǎo, wǒ shì".toString(), TextToSpeech.QUEUE_FLUSH, null);
    }
}

请帮助我,在此先感谢...

4

0 回答 0