简书链接:使情迁工具箱朗读语音的代码
文章字数:38,阅读全文大约需要1分钟
首先必须进入语音界面

任意app执行下面代码

1
2
3
4
5
6
7
Intent action = new Intent();
action.setAction("cn.qssq666.systool.voice");
action.putExtra("voice_title", "" + str);
action.putExtra("voice_speed", "10");
String callBackIntent = "qq_voice_call_back";
action.putExtra("voice_callback", callBackIntent);
context.sendBroadcast(action);

voice_title 为朗读的文字
voice_speed 为朗读速度