When I downloaded at least something I create Sound instance and start playing audio from file path.
An this moment sound.getDuration() returns ~16 seconds, which is correct.
Source continue downloading and sound keep playing. Doesn't matter how many time it will play, but getDuration keep returning 16 seconds. Even when current position is 5 minutes.
When I restart device with cached file (download is finished), it will return real total value. (example: 6mins)
:beetle: What is the expected behavior?
It will return correct value. I expect to get different value in downloading process. (between 16sec and 6mins)
:beetle: Please post your code:
Code is same like in docs
:bulb: Possible solution
Seems like sound instance keeps value of initial duration, and just continue returning it. Maybe this behavior is ok for you. I'd like to be able to do force duration get.
:bulb: Is there a workaround?
I tried to create different instance of Sound just for getting duration, when file upload is finished. But I got error: ENSOSSTATUSERRORDOMAIN-10875
:bulb: If the bug is confirmed, would you be willing to create a pull request?
No
Is your issue with...
iOS
Are you using...
React Native CLI
Which versions are you using?
React Native Sound: 0.61.5
React Native: 0.11.0
Xcode: 11.2.1
Does the problem occur on...
Simulator
If your problem is happening on a device, which device?
:beetle: Description
I do download audio source with:
When I downloaded at least something I create Sound instance and start playing audio from file path. An this moment
sound.getDuration()
returns ~16 seconds, which is correct.Source continue downloading and sound keep playing. Doesn't matter how many time it will play, but getDuration keep returning 16 seconds. Even when current position is 5 minutes.
When I restart device with cached file (download is finished), it will return real total value. (example: 6mins)
:beetle: What is the expected behavior?
It will return correct value. I expect to get different value in downloading process. (between 16sec and 6mins)
:beetle: Please post your code:
Code is same like in docs
:bulb: Possible solution
Seems like sound instance keeps value of initial duration, and just continue returning it. Maybe this behavior is ok for you. I'd like to be able to do force duration get.
:bulb: Is there a workaround?
I tried to create different instance of Sound just for getting duration, when file upload is finished. But I got error:
ENSOSSTATUSERRORDOMAIN-10875
:bulb: If the bug is confirmed, would you be willing to create a pull request?
No
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?
I think it happens on any device