react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

Error with audio file that comes from the web

Open oviedo97fer opened this issue 4 years ago • 3 comments

:beetle: Description

I develop a multiple platform app that runs on ios, android and web. To ios and android, I'd with RN and React to web. When I record audio in mobile, that sound reproduces ok, but when audio is recorded from web doesn't work on mobile (yes on the web)

MIME-type that I use is 'audio/mp4' on all platforms.

I log object that return new Sound in every case and obtain next:

audio comes from web app. Doesn't works Anotación 2020-08-24 162710 audio comes from another mobile device. Works Anotación 2020-08-24 163001

if you see, the only difference is that the duration in case the audio works fine log correctly, but in the case that sound doesn't work, the duration is 0

NOTE: the audio is not broken, I can play it normally from URL origin or by downloading the file :beetle: What is the observed behavior?

The sound file that comes from the web doesn't work on mobile

:beetle: What is the expected behavior?

Sound file should work fine

:beetle: Please post your code:

this.player = new Sound(uri, null, (error) => {
          
            if (error) {
                console.error('Error with sound')
            }

         //... work with sound duration
        });

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

  • [x] iOS
  • [x] Android
  • [ ] Windows

Are you using...

  • [x] React Native CLI (e.g. react-native run-android)
  • [ ] Expo
  • [ ] Other: (please specify)

Which versions are you using?

  • React Native Sound: "^0.10.12"
  • React Native: "0.59.10"
  • iOS: 13
  • Android: 9
  • Windows:

Does the problem occur on...

  • [x] Simulator
  • [x] Device

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

  • Device: Xiaomi Redmi 7 Note, Samsung S8, Iphone X, Iphone 7

oviedo97fer avatar Aug 24 '20 19:08 oviedo97fer

Try upgrading to react native 0.63

karimatwa avatar Nov 01 '20 15:11 karimatwa

Any update?

amjadbouhouch avatar Dec 03 '21 14:12 amjadbouhouch

Same problem for me, any update on that ? ..

talal-tilted avatar Nov 03 '22 19:11 talal-tilted