SpeechSynthesizer那里报错 ‘SpeechSynthesizer’ is abstract, cannot no be instantiated 要怎么改啊
ouyuyao双子 发布于2015-08 浏览:3709 回复:1
0
收藏
private void initVoice() {   speechSynthesizer = new SpeechSynthesizer(MainActivity.this, "holder",this);    // 将setApiKey方法的两个参数替换为注册的apiKey和secretKey    speechSynthesizer.setApiKey("pppppppppppp","pppppppppppppppppppppppppppppppppppppppp");    speechSynthesizer.setAudioStreamType(AudioManager.STREAM_MUSIC);    setVolumeControlStream(AudioManager.STREAM_MUSIC);}
收藏
点赞
0
个赞
共1条回复 最后由用户已被禁言回复于2022-04
#2李维高liweigao回复于2015-09

该类是单实例的,需要通过newInstance方法初始化,请仔细看下sample工程

0
TOP
切换版块