环境是hbuilderx4.75 DevEco Studio5.1.1
用uniappx开发鸿蒙APP
实现把文字转成语音播放时,
textToSpeech (文本转语音)
import { textToSpeech } from '@kit.CoreSpeechKit';
做成uts插件,但是报错:
15:22:03.654 [INFO] 2025-08-30 00:59:34.053 - [TTSService] 开始初始化TTS引擎 at app-service.js:1301 at utils/logger.uts:97
15:22:03.654 [UTS-TTS] 开始初始化TTS引擎 at uni_modules/uts-tts/utssdk/app-harmony/index.uts:28
15:22:03.654 ---------- at uni_modules/uts-tts/utssdk/app-harmony/index.uts:30
15:22:03.654 [UTS-TTS] 初始化异常: [TypeError] Cannot read property createEngine of undefined at uni_modules/uts-tts/utssdk/app-harmony/index.uts:62
15:22:03.655 [ERROR] 2025-08-30 00:59:34.057 - [TTSService] TTS引擎初始化失败: 初始化异常 at index.ets:53 at utils/logger.uts:117
15:22:03.655 [ERROR] 2025-08-30 00:59:34.058 - [TTSService] TTS未初始化,组别紧急播报失败 at app-service.js:1286 at utils/logger.uts:117
15:22:03.655 [HomeView] TTS播报失败 at pages/home/index.uvue:137
是不是没能加载成功
需要ohpm安装安装吗,现在调用不成功,应该是怎么样的步骤使用。还有tts文字 转语音需要配置权限吗(不用录音)
0 个回复