电容器文本到语音 API 不适用于 android

问题描述

每当我尝试从 {{collection.products}} 执行 TextToSpeech.speak() 函数时都会收到此错误

@capacitor-community/text-to-speech@0.2.3

这是我的代码如下:

Uncaught (in promise) Error: Not supported on this device.
    at n.value (29.a169ec33.chunk.js:formatted:3022)
    at n.<anonymous> (29.a169ec33.chunk.js:formatted:2842)
    at c (26.902cd79a.chunk.js:2)
    at Generator._invoke (26.902cd79a.chunk.js:2)
    at Generator.next (26.902cd79a.chunk.js:2)
    at 29.a169ec33.chunk.js:formatted:2816
    at new Promise (<anonymous>)
    at l (29.a169ec33.chunk.js:formatted:2793)
    at n.value (29.a169ec33.chunk.js:formatted:2836)
    at 29.a169ec33.chunk.js:formatted:4997

每当我触发该功能时,它都会给我上面的错误。有人经历过吗?

模块: import { TextToSpeech } from '@capacitor-community/text-to-speech'; const androidSpeak = async () => { await TextToSpeech.speak({ text: 'This is a sample text.',locale: 'en_US',pitchRate: 1.0,speechRate: 1.0,volume: 1.0,category: 'ambient',}); }; @capacitor/android: ^2.4.2 https://github.com/capacitor-community/text-to-speech

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)