React Native with Expo可通过麦克风监测用户的音高



你好,我想通过react native expo制作一个简单的平台游戏,看起来有点像flappy bird,但使用用户语音作为输入。

我试过使用@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)

我可以在expo上使用任何不同的库来监控用户的音高吗?

很抱歉问这个愚蠢的问题,我已经使用react原生bareworkflow 解决了这个问题

相关内容

  • 没有找到相关文章

最新更新