#include <QtTextToSpeech/QTextToSpeech>
QTextToSpeech *tts = new QTextToSpeech(this);
tts->setLocale(QLocale::Chinese);//设置语言环境
tts->setRate(0.0);//设置语速-1.0到1.0
tts->setPitch(1.0);//设置音高-1.0到1.0
tts->setVolume(1.0);//设置音量0.0-1.0
if (tts->state() == QTextToSpeech::Ready)
{
tts->say(CHINESE("北京欢迎你"));//开始合成文本
}
qt文字转语音
最新推荐文章于 2024-09-24 09:23:53 发布