1
  const audio = new Sound(
      'https://storage.googleapis.com/chat_bucket_aso/2ihzd4q47l73wmvcb_2.976.mp3',
      null,
      error => {
        setLoadingAudio(false);
        if (error) {
          console.log('failed to load the sound', error);
          setError(true);
          return;
        }
        setDuration(hp.recorderTimeFormat(audio.getDuration()));
        setPlayingDuration(audio.getDuration());
      },
    );

I am using React Native sound and this works in Android and get "The operation couldn’t be completed. (OSStatus error 1954115647.)" error in IOS.

Wahlstrommm
  • 684
  • 2
  • 7
  • 21

1 Answers1

0

If you're facing the OSStatus error -10875 while using Firebase storage with React Native Sound, it's possible that the URL you're using contains special characters that are causing the issue. One possible workaround is to modify the RNSound package by modifying code in RNSound.m file.

To do this, navigate to the RNSound package in your project's node_modules folder and open the RNSound.m file. Look for the following line of code:

fileNameUrl = [NSURL URLWithString:fileNameEscaped];

replace it with

fileNameUrl = [NSURL URLWithString:fileName];

This modification will remove the URL encoding from the file name and should allow React Native Sound to load the audio file from Firebase storage without encountering the OSStatus error.

Jogy Felix
  • 11
  • 1