zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

The operation couldn’t be completed. (OSStatus error 2003334207.) #724

Open gulsher7 opened 3 years ago

gulsher7 commented 3 years ago

Audio not play in ios please help i mentioned error screenshot below

Screenshot 2021-05-18 at 4 03 23 PM

marciok commented 3 years ago

Check your audio format, iOS does not support ogg files 😞

gulsher7 commented 3 years ago

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

GhayoorUlHaq commented 3 years ago

Same issue with '.wav' extension

GhayoorUlHaq commented 3 years ago

You need to add audio to Resources in Xcode. Refer to this one. https://github.com/zmxv/react-native-sound/issues/64#issuecomment-346956562

kyoz commented 2 years ago

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. @@

kyoz commented 2 years ago

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.

duasfh commented 2 years ago

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)

doronpr commented 2 years ago

Hey guys I wrote a react-native decoder to solve this: https://github.com/wix-incubator/react-native-opus-decode Enjoy :)

cheuchheang commented 1 year ago

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!