如何解决电容器文本到语音 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 举报,一经查实,本站将立刻删除。