zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.79k stars 747 forks source link

In version 0.11.1 this issue continue in IOS "code": "ENSOSSTATUSERRORDOMAIN-10875", "domain": "NSOSStatusErrorDomain", "message": "The operation couldn’t be completed. (OSStatus error -10875.) #772

Open FayyazAliKhan1 opened 2 years ago

FayyazAliKhan1 commented 2 years ago

:beetle: In version 0.11.1 this issue continue in IOS "code": "ENSOSSTATUSERRORDOMAIN-10875", "domain": "NSOSStatusErrorDomain", "message": "The operation couldn’t be completed. (OSStatus error -10875.)

:beetle: What is the observed behavior?

:beetle: What is the expected behavior?

:beetle: Please post your code:

// Please post your code

:bulb: Does the problem have a test case?

:bulb: **Possible solution**

:bulb: Is there a workaround?

:bulb: If the bug is confirmed, would you be willing to create a pull request?

Is your issue with...

Are you using...

Which versions are you using? 0.64.2

Does the problem occur on... Both

If your problem is happening on a device, which device?

dippathak26 commented 2 years ago

Hello, I am facing the same issue that @FayyazAliKhan1 is facing in IOS device (Iphone 6s) and I am using the latest version 0.11.1. It works like charm in Android but not IOS. I have also tried to downgrade the version to 0.11.0, but still I am facing the same issue. Would you please help me out here?

FayyazAliKhan1 commented 2 years ago

@dippathak26 0.11.0 is fine clear this library from pods nodemodules and lock file and install it using @0.11.0 specific

dippathak26 commented 2 years ago

@FayyazAliKhan1 Hi, I have done all what you have mentioned and now I am using react-native-sound@0.11.0, but still it's throwing me the same error in iOS. It works fine in Android. It would be kind of you, if you have any solution for this. Please check the attached screenshot. Thank you :) Screenshot 2021-12-24 at 12 22 09 PM

gilshaan commented 2 years ago

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;
                  }
                });

My issue got resolved by doing this.

vuhoangminh199 commented 2 years ago

any update ?

flogy commented 2 years ago

Having the same issue on iOS with version 0.11.2. On Android it works fine.

abdoerrahiem commented 2 years ago

Having same problem. any update?

lmarques6 commented 2 years ago

When upgrading from 0.11.0 to 0.11.2 I also ran into this issue. What I found that worked was changing my MainBundleDir from const MainBundleDir = Platform.OS === 'ios' ? encodeURI(RNSound.MAIN_BUNDLE) : null to const MainBundleDir = Platform.OS === 'ios' ? RNSound.MAIN_BUNDLE : null

Removing encodeUri worked because it is now being escaped in the native code, whereas in version 0.11.0 it was not.

qtipee commented 2 years ago

When upgrading from 0.11.0 to 0.11.2 I also ran into this issue. What I found that worked was changing my MainBundleDir from const MainBundleDir = Platform.OS === 'ios' ? encodeURI(RNSound.MAIN_BUNDLE) : null to const MainBundleDir = Platform.OS === 'ios' ? RNSound.MAIN_BUNDLE : null

Removing encodeUri worked because it is now being escaped in the native code, whereas in version 0.11.0 it was not.

Where do you do that?

ghost commented 1 year ago

You can make audioPath => decodeURI(audioPath) and Sound.MAIN_BUNDLE into "" (empty string) for IOS