Open gulsher7 opened 3 years ago
Check your audio format, iOS does not support ogg files 😞
thanks for your reply but i'm using mp3 file here is the link https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3
Same issue with '.wav' extension
You need to add audio to Resources in Xcode. Refer to this one. https://github.com/zmxv/react-native-sound/issues/64#issuecomment-346956562
I'v have the same problem with iOS (on Android it working perfectly).
Have added sound file (.wav) to Resources. Double check and it is all in Copy Bundle Resources in Build Phases.
On iOS if i set Sound.MAIN_BUNDLE
or even encodeURIComponent(Sound.MAIN_BUNDLE)
it will have an load fail error in XCode output.
When change Sound.MAIN_BUNDLE
to '' (empty string). The load fail error disappear but it jump to error callback with error just like @gulsher7 has show. @@
LMFAO. I'v found out why my audio not play and having this issue. I'm using wav file and it not work. Doesn't know why, but convert everything to .mp3 and it work perfectly.
For me it was not working for wav. With mp3 it worked: Sound.MAIN_BUNDLE -- without encodeUri, file -- directly in root project folder.
Probably also may add it to Resources and prefix filename or postfix second arg with '/Resources' (but not sure)
Hey guys I wrote a react-native decoder to solve this: https://github.com/wix-incubator/react-native-opus-decode Enjoy :)
I've just met this problem today. In my case, I used the react-native-sound
library and I put the wrong file path accidently. So it works after I fix it. But I'm not sure if it's the same with your case. Thank you!
Audio not play in ios please help i mentioned error screenshot below