React-native-sound: Voice recorded audio not working in iOS

Created on 8 Mar 2020  路  2Comments  路  Source: zmxv/react-native-sound

:beetle: Description

Reproducible step:

  • Record audio from any voice recorder app (try with ios and android also). It will save in mp3 format.
  • Play both recorded audio in android and iOS.
  • Both audio play in android, but iOS failed to play both.

Note: Files are not recorded via react-native-audio. It's from another app.

:beetle: What is the observed behavior?
It failed to play recorded audio in iOS.
failed to load the sound {code: "ENSOSSTATUSERRORDOMAIN1818327410", message: "The operation couldn鈥檛 be completed. (OSStatus error 1818327410.)", nativeStackIOS: Array(17), domain: "NSOSStatusErrorDomain", userInfo: {鈥}

:beetle: What is the expected behavior?
It should play Voice recorded audio in iOS also.

:beetle: Please post your code:

loadSound = playSeconds => {
    file = filePath + '/' + date + this.state.fileType;

    setTimeout(() => {
      this.sound = new Sound(file, '', error => {
        if (error) {
          Logger.log('failed to load the sound', error);
        } else {
          this.startPlaying();
        }
      });
    }, 100);
  };

Which versions are you using?

  • React Native Sound: "0.10.9",
  • React Native: "0.59.3"

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

  • Device: iOS
question

All 2 comments

@schumannd @paulmelnikow Need your help please. Thanks!

we have since moved to using the package expo-av as we were experiencing problems with audio playback on iOS.

Was this page helpful?
0 / 5 - 0 ratings