关于ios的文字转语音,怎么让它暂停播放等操作,它的监听事件怎么写
function speak() {
var AVSpeechSynthesizer = plus.ios.importClass("AVSpeechSynthesizer");
var AVSpeechUtterance = plus.ios.importClass("AVSpeechUtterance");
var AVSpeechSynthesisVoice = plus.ios.import("AVSpeechSynthesisVoice");
var sppech = new AVSpeechSynthesizer();
var voice = AVSpeechSynthesisVoice.voiceWithLanguage("zh-CN");
var utterance = AVSpeechUtterance.speechUtteranceWithString(“哈哈哈哈哈”);
utterance.setVoice(voice);
sppech.speakUtterance(utterance);
plus.ios.deleteObject(voice);
plus.ios.deleteObject(utterance);
plus.ios.deleteObject(sppech);
}
1 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
离线文本转语音、支持生成音频、下载或播放状态监听(ios) :https://ext.dcloud.net.cn/plugin?id=9286