New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The operation couldn’t be completed. (OSStatus error -10875.) #120
Comments
Perhaps it's the typo in your code |
I think it's not a typo because I imported it as Sounddd. But to be sure I tested like this:
And I have the same error |
@zakster12 Ah you are right about the import, apologies. Can you check the mp3 is included in the app bundle (build phases, copy bundle resources)? |
@benvium thanks for trying to help me. Yes, the mp3 is listed there. |
@zakster12 had the same problem related to the audio path , made it work by using
|
@Ali-Ayyad with your snippet of code right now I do not have any errors but there is no sound at all. I tried with .mp3 and with .wav and there is no sound. |
@freiserg Thanks for that - sounds like there's been a regression due to that commit. I'll investigate |
@freiserg @zakster12 So react-native-sound-demo works fine with RNSound 0.9.0. Checking into it the difference is that in there I wait for the constructor callback before calling .play() e.g: const s = new Sound('advertising.mp3', Sound.MAIN_BUNDLE, (e) => {
if (e) {
console.log('error', e);
} else {
s.setSpeed(1);
console.log('duration', s.getDuration());
s.play(() => s.release()); // Release when it's done so we're not using up resources
}
}); If I move the So a workaround is to use the callback before you play the audio. EDIT: Looking at the sound.js file the play command is ignored if the file isn't loaded. Always use the callback before calling play :-) |
@zakster12 try |
There was a bug preventing setCategory from working if the mixWithOthers param wasn't set see #124. I made a PR to fix that.. |
Thanx for the suggestions here: @Ali-Ayyad @benvium , I got rid of this errors, but I am also experiencing the exact set of descriptions that @zakster12 gave. Currently no sound. 0.9.1 |
Hello I'm having a similar issue as @lagofvc . No errors in my code besides failing to play the sound. Getting "The operation couldn't be completed", even though I have included my sound on Xcode and have basically just copy and pasted from the demo code. Any troubleshooting that should be done to go about fixing this? |
@lagofvc @Darthmaul I presume you've tried |
Resolved |
@benvium , Thanx! Yes, I did try with the |
Hey thanks for the response @benvium ! I just did a clean xcode install on my brand new mac and the sound works fine. Not sure what was wrong, I guess switching to a new system worked. |
did you try replace Sounddd.MAIN_BUNDLE with ''? |
Hi! If you are still experiencing this issue in the latest version, could you please open an issue with more details following the issue template? Thanks! |
For iOS what worked for me is the following:
This is my code: const sound = new Sound(
"myFile.mp3",
Sound.MAIN_BUNDLE,
error => {
if (error) {
console.log("failed to load the sound", error);
return;
}
sound.play(() => sound.release());
}
);
// The play dispatcher
sound.play(); |
Hi for what it's worth, I've been getting this error and after rolling my project back to earlier commits I discovered that sound stopped working after I changed the project's "Display Name" to something with a space in it. Going back to a name without spaces made it work again. |
|
Hello, guys. I have the following error when trying to play a sound. I will attach an image of the error below. Here is my code:
The text was updated successfully, but these errors were encountered: