我有一个react原生移动应用程序,可以用google tts发音。但是它在第四十个发音之后就不起作用了。在退出应用程序并重新进入它之后,它开始工作。我认为这与google tts api有关。我该怎么解决它呢?
发布于 2021-10-30 08:37:32
您需要添加"speech.release()“代码:
const speech = new Sound(voice, '', (error) => {
if (error) {
console.warn('failed to load the sound', error)
return
}
speech.play((success) => {
if (!success) {
console.warn('playback failed due to audio decoding errors')
}else{
speech.release() // Need to add this code
}
})
return
})https://stackoverflow.com/questions/69770321
复制相似问题