Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android中使用expo语音不会';t工作并抛出异常_Android_React Native_Expo_Text To Speech - Fatal编程技术网

在android中使用expo语音不会';t工作并抛出异常

在android中使用expo语音不会';t工作并抛出异常,android,react-native,expo,text-to-speech,Android,React Native,Expo,Text To Speech,我试图在我的react native应用程序中使用expo speech,但在我的Android上出现以下错误: [Unhandled promise rejection: Error: Encountered an exception while calling native method: Exception occurred while executing exported method speak on module ExponentSpeech: null] - node_module

我试图在我的react native应用程序中使用expo speech,但在我的Android上出现以下错误:

[Unhandled promise rejection: Error: Encountered an exception while calling native method: Exception occurred while executing exported method speak on module ExponentSpeech: null]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:155:41 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:55 in <unknown>
- ... 5 more stack frames from framework internals
反应本机:0.59.8

依赖项如下所示:

speak = async text => {
  Speech.speak(convertHTMLstring(text), {
    language: 'he',
    pitch: '1',
    rate: '0.9',
  })
}
"expo": "^35.0.0",
"expo-speech": "~7.0.0",
"react": "16.8.3",
...
同样的代码在ios中工作

我试图寻找答案,但什么也找不到,根据expo docs,它应该支持Android:

请帮忙。
谢谢。

听起来这是一个纯本地项目,而不是一个管理的世博会项目,对吗?如果是这样,请确保首先在您的项目中设置react native unimodules:

适用于所有可能与其相关的人。。。 我发现了问题。 首先,请注意,我试图使用希伯来语的讲话。 因此:

  • Android默认没有希伯来语的TTS引擎。我必须下载并安装它。我没有找到任何免费的,但我找到了一个7天免费试用的:

  • 我的代码中的俯仰和速率选项不起作用(可能是因为这个引擎),并导致异常


  • 就这样

    据我所知,我使用的是一个管理的世博会项目,但我不是100%确定(对不起,react native和expo非常新)。我使用expo API,实际上文本到语音包也是从expo:import*导入的,作为来自“expo speech”的语音,那么,我如何检查我使用的是本机项目还是托管的expo项目?如果我使用管理世博会项目,你知道我为什么会出现这个错误吗?谢谢有人知道我的问题吗?