你好,我想通过 react-native expo 制作一个简单的平台游戏,有点像小鸟,但使用用户语音作为输入。
我试过使用@react-native-community/voice
,但我得到了这个错误
TypeError: Cannot read property 'startSpeech' of undefined
at index.js:75
at new Promise (<anonymous>)
at RCTVoice.start (index.js:57)
at onStartButtonPress$ (App.js:40)
at tryCatch (runtime.js:45)
at Generator.invoke [as _invoke] (runtime.js:274)
at Generator.prototype.<computed> [as next] (runtime.js:97)
at tryCatch (runtime.js:45)
at invoke (runtime.js:135)
at runtime.js:170
at new Promise (<anonymous>)
at callInvokeWithMethodAndArg (runtime.js:169)
at AsyncIterator.enqueue [as _invoke] (runtime.js:192)
at AsyncIterator.prototype.<computed> [as next] (runtime.js:97)
at Object.../../../../../../../../../../../Desktop/phase-3/coretan/testVoice2/node_modules/regenerator-runtime/runtime.js.exports.async (runtime.js:219)
at Object.onStartButtonPress [as onPress] (App.js:40)
at Object.touchableHandlePress (index.js:117)
at Object._performSideEffectsForTransition (index.js:730)
at Object._receiveSignal (index.js:642)
at Object.touchableHandleResponderRelease (index.js:428)
at domProps.<computed> (index.js:65)
at HTMLUnknownElement.callCallback (react-dom.development.js:347)
at Object.invokeGuardedCallbackDev (react-dom.development.js:397)
at invokeGuardedCallback (react-dom.development.js:454)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:468)
at executeDispatch (react-dom.development.js:600)
at executeDispatchesInOrder (react-dom.development.js:622)
at executeDispatchesAndRelease (react-dom.development.js:725)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:733)
at Array.forEach (<anonymous>)
at forEachAccumulated (react-dom.development.js:705)
at runEventsInBatch (react-dom.development.js:750)
at runExtractedPluginEventsInBatch (react-dom.development.js:881)
at handleTopLevel (react-dom.development.js:5901)
at batchedEventUpdates (react-dom.development.js:2344)
at dispatchEventForPluginEventSystem (react-dom.development.js:5996)
at dispatchEvent (react-dom.development.js:6025)
at unstable_runWithPriority (scheduler.development.js:643)
at runWithPriority$2 (react-dom.development.js:11305)
at discreteUpdates$1 (react-dom.development.js:21672)
at discreteUpdates (react-dom.development.js:2359)
at dispatchDiscreteEvent (react-dom.development.js:5979)
我可以在世博会上使用任何不同的库来监控用户的音调吗?