Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.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
React native 反应本机声音加载错误。com.google.android.exoplayer2.b.h$b:AudioTrack初始化失败:0,配置(44100,422050)_React Native_React Native Android_Expo - Fatal编程技术网

React native 反应本机声音加载错误。com.google.android.exoplayer2.b.h$b:AudioTrack初始化失败:0,配置(44100,422050)

React native 反应本机声音加载错误。com.google.android.exoplayer2.b.h$b:AudioTrack初始化失败:0,配置(44100,422050),react-native,react-native-android,expo,React Native,React Native Android,Expo,我的React Native应用程序中有许多声音文件,我可以90%的时间播放这些文件而不会出现问题。但是,有时我会出现以下错误,而不是播放声音文件: com.google.android.exoplayer2.b.h$b: AudioTrack init failed: 0, Config(44100, 4, 22050) - node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:30 in <unkn

我的React Native应用程序中有许多声音文件,我可以90%的时间播放这些文件而不会出现问题。但是,有时我会出现以下错误,而不是播放声音文件:

com.google.android.exoplayer2.b.h$b: AudioTrack init failed: 0, Config(44100, 4, 22050)
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:30 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:12 in MessageQueue.__invokeCallback
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:127:11 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314:8 in MessageQueue.__guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:126:9 in MessageQueue.invokeCallbackAndReturnFlushedQueue
* http://localhost:19001/debugger-ui/debuggerWorker.js:80:58 in <unknown>
该错误不是特定于该文件的。有时一个文件可以工作,有时则不能。文件失败后,尝试加载所有其他文件时会出现错误:

[Unhandled promise rejection: Error: Player does not exist.]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:155:31 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:30 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:12 in MessageQueue.__invokeCallback
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:127:11 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314:8 in MessageQueue.__guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:126:9 in MessageQueue.invokeCallbackAndReturnFlushedQueue
* http://localhost:19001/debugger-ui/debuggerWorker.js:80:58 in <unknown>
有人知道如何解决这个问题/为什么会发生这种情况吗?我正在使用expo av进行声音测试,并在物理像素2上通过expo对应用程序进行测试

从一个真正被困住的傻瓜那里!欢迎大家帮忙

[Unhandled promise rejection: Error: Player does not exist.]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:155:31 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:30 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:12 in MessageQueue.__invokeCallback
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:127:11 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314:8 in MessageQueue.__guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:126:9 in MessageQueue.invokeCallbackAndReturnFlushedQueue
* http://localhost:19001/debugger-ui/debuggerWorker.js:80:58 in <unknown>
Audio.setIsEnabledAsync(true);
            const soundObject = new Audio.Sound();

            firebase.storage().ref().child(this.props.wave.audio).getDownloadURL()
                .then((url) => {
                    soundObject.loadAsync({ uri: url })
                        .catch(err => { console.log(err) })
                        .then(() => {

                            this.setState({ curRecording: soundObject }); 
                            soundObject.playAsync()
                                .catch(err => { console.log(err) })
                                .then(() => {
                                    this.setState({ actualPlaying: true });
                                    this.props.setSound(soundObject);
                                    //this.updatePlays();
                                    soundObject.setOnPlaybackStatusUpdate((playbackStatus) => {
                                        if (playbackStatus.didJustFinish) {

                                            this.setState({ playing: false, actualPlaying: false });
                                            this.props.changeNum("plays", 1, this.props.wave.key, "wave");
                                            this.props.isNotPlaying();
                                            this.props.next();
                                            this.props.setSound("");

                                            let data = { userid: this.props.ownUserid, wave: this.props.wave.key, type2: "wave" };
                                            firebase.database().ref('/Requests/Plays').push(data).catch(err => { console.log(err) });
                                        }
                                    })
                                });
                        })

                });