React native 在ios 13上的react native webview中,speechSynthesis不起作用

React native 在ios 13上的react native webview中,speechSynthesis不起作用,react-native,text-to-speech,ios13,react-native-webview,React Native,Text To Speech,Ios13,React Native Webview,我使用react native webview在ios 13上显示生成的html和触发window.speechSynthesis.speak(话语),但speaking并没有启动。 反应本机:0.60v 代码示例: var synth=新的演讲(内容); window.speechSynthesis.speak(synth) 首先,确保内容不是空白的!控制台日志(内容);如果可以的话,也许你必须先得到声音:const voices=speechSynthesis.getVoices()并为话语

我使用react native webview在ios 13上显示生成的html和触发window.speechSynthesis.speak(话语),但speaking并没有启动。 反应本机:0.60v 代码示例:


var synth=新的演讲(内容);
window.speechSynthesis.speak(synth)

首先,确保内容不是空白的!控制台日志(内容);如果可以的话,也许你必须先得到声音:
const voices=speechSynthesis.getVoices()并为话语分配一个语音:
synth.voice=voices[0]
synth.lang=voices[0].lang
然后运行speak命令。不,它在iphone 11pro和ios 13上不起作用。请添加完整代码和html.synth=new SpeechSynthesisUtterance(content);const voices=speechSynthesis.getVoices();语音状态=1;lastCall=回调;试试{synth.voice=voices[0];synth.lang=voices[0].lang;window.speechSynthesis.speak(synth);}catch(e){post(“speak error=“+e”);}我在动态生成的html上使用它,并首先为一个段落触发它,确保内容不是空的!控制台日志(内容);如果可以的话,也许你必须先得到声音:
const voices=speechSynthesis.getVoices()并为话语分配一个语音:
synth.voice=voices[0]
synth.lang=voices[0].lang
然后运行speak命令。不,它在iphone 11pro和ios 13上不起作用。请添加完整代码和html.synth=new SpeechSynthesisUtterance(content);const voices=speechSynthesis.getVoices();语音状态=1;lastCall=回调;试试{synth.voice=voices[0];synth.lang=voices[0].lang;window.speechSynthesis.speak(synth);}catch(e){post(“speak error=“+e”);}我在动态生成的html上使用它,并为一个段落触发它