I am using "react-native-audio" to record sounds in .aac format and upon finishing recording successfully, I am receiving this cryptic error from "react-native-sound": { extra: -2147483648, what: 1 } when I attempt to load the sound from the recorded file path.
I've tried recording in different formats but the problem remains the same. There doesn't seem to be another issue filed with a similar error message occurring. Does anyone know what this error message is trying to convey?
The problem was caused by including symbols in my file path. Essentially I was instantiating my file path like this audioPath: AudioUtils.DocumentDirectoryPath + '/' + new Date().replace(/\s/g, '_') + '.aac' which made it appear like this: '/data/data/com.app/file/Sat_Apr_28_2018_15:55:30_GMT+0800_(CST).aac' which is not permitted as a valid file path. So I've switched to a Date.now() format which does work: '/data/data/com.app/file/1524902226397.aac' Hope this helps.
It seems like any characters in the filename cause this issue - even underscores.
I'm getting this error when I try to load local audio file from android/app/res/raw/audio.mps
I'm having the same problem and does not have no underscores and special chacters in android release
I am having the same issue when trying to load with the URL its loading songs of 2 or 3 minutes and a recording file of 30 secs but not loading a recorded file of more than 30 secs. Any one, please help.
ToastAndroid.show("Audio is loading please wait..", ToastAndroid.SHORT)
sound1 = new SoundPlay("http://alldoo.net/TaskmanagementApp/"+link , '',(error, sound)=>{
if(error){
alert(JSON.stringify(error));
return;
}
sound1.play(()=>{
sound1.release();
})
ToastAndroid.show("You audio is started", ToastAndroid.SHORT)
setTimeout(()=>{
this.StopAudio()
this.PauseIcons();
this.setState({currentPlayedMessage:0});
},sound1.getDuration()*1000);
})
Same problem here on android, any solutions???
Most helpful comment
The problem was caused by including symbols in my file path. Essentially I was instantiating my file path like this
audioPath: AudioUtils.DocumentDirectoryPath + '/' + new Date().replace(/\s/g, '_') + '.aac'which made it appear like this:'/data/data/com.app/file/Sat_Apr_28_2018_15:55:30_GMT+0800_(CST).aac'which is not permitted as a valid file path. So I've switched to aDate.now()format which does work:'/data/data/com.app/file/1524902226397.aac'Hope this helps.