每当我试图从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 @capacitor-community/text-to-speech: ^0.2.3 https://github.com/capacitor-community/text-to-speech
发布于 2022-02-28 02:38:08
把语言从'en_US‘改为'en’,它就能工作了。
https://stackoverflow.com/questions/68061862
复制相似问题