Open dippathak26 opened 2 years ago
Hi @dippathak26 any update ?
@amjadbouhouch Hi, I have no update yet, but I have found another solution for playing the sound. You can check out the beloiw link for that:
Pass second argument as '' for ios and Sound.DOCUMENT or other values for android. Please see the below code
var whoosh = new Sound(path + '/audio/test.mp3', Platform.OS === 'ios' ? '' : Sound.DOCUMENT, (error) => {
if (error) {
console.log('failed to load the sound', error);
return;
}
});
For us what worked was adding the sound to the root directory (not the Resource directory), downgrading to version 0.11.0 (not 0.11.2) and encoding the uri
Try this solution too you might need to encode Sound.MAIN_BUNDLE
Facing issue in react-native-sound latest version 0.11.1 "The operation couldn’t be completed. (OSStatus error -2003334207.)"
I have used react-native-sound version 0.11.1 and playing sound from local (i.e. in Android -> res/raw and in iOS -> Resource folders respectively). I have also tried to downgrade to the older version 0.11.0 as it was working well, but still I am facing the same issue. Please check below code:
const soundBundle = Platform.OS === 'ios' ? encodeURIComponent(Sound.MAIN_BUNDLE) // also used empty string("") and null, but getting the same output : Sound.MAIN_BUNDLE; sound = new Sound(audioUrl, soundBundle, error => { if (error) { console.log('failed to load the sound ====>>>>>>', error); } else { console.log('sound loaded'); } });
:bulb: Is there a workaround?
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?