Android自带语音播报

 
import android.speech.tts.TextToSpeech;


tts = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
    @Override
    public void onInit(int status) {
        //初始化成功的话,设置语音
        if (status == TextToSpeech.SUCCESS) {
            tts.setLanguage(Locale.CHINESE);
            tts.speak("左偏120度 右偏86度", TextToSpeech.QUEUE_FLUSH, null);
        }
    }
});

你可能感兴趣的:(Android)