讯飞语音
* 在讯飞语音开发者平台上http://www.xfyun.cn/doccenter/newer具体准备工作按照开发文档操作。注意的是创建一个项目,appid和adk是一一对应的*
在这里,写了一个语音转化为文本,文本转化为语音的工具类VoiceUtils
public class VoiceUtils {
/**
* 文本转换成语音
*/
public static void textToVoice(Context context, String text) {
//1.创建SpeechSynthesizer对象, 第一个参数上下文,第二个参数:本地合成时传InitListener
SpeechSynthesizer mTts = SpeechSynthesizer.createSynthesizer(context, null);
//2.合成参数设置,详见《科大讯飞MSC API手册(Android)》SpeechSynthesizer 类
mTts.setParameter(SpeechConstant.VOICE_NAME, "xiaoyan");//设置发音人
mTts.setParameter(SpeechConstant.SPEED, "50");//设置语速
mTts.setParameter

最低0.47元/天 解锁文章
1064

被折叠的 条评论
为什么被折叠?



