zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

Error with audio file that comes from the web #699

Open oviedo97fer opened 3 years ago

oviedo97fer commented 3 years ago

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

Are you using...

Which versions are you using?

Does the problem occur on...

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

karimatwa commented 3 years ago

Try upgrading to react native 0.63

amjadbouhouch commented 2 years ago

Any update?

talal-tilted commented 1 year ago

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