You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I put the getInfo inside SetInterval to get current Time every Second.
it return me current time and duration.
The duration is wrong that is less than the currentTime
To Reproduce
Using
setInterval(() => {
this.getInfo()
}, 1000);
async getInfo() { // You need the keyword `async`
try {
const info = await SoundPlayer.getInfo()
this.setState({ audioPlayer: { ...this.state.audioPlayer, duration: (info.duration).toFixed(2), currentTime: (info.currentTime).toFixed(2) } })
} catch (e) {
console.log('There is no song playing', e)
}
}
Expected behavior
duration shoould be equal or bigger than the current time.
Platform (please complete the following information):
Tested on Android only.
The text was updated successfully, but these errors were encountered:
I can't see which audio type you use, but I assume that it takes the current time and duration wrong depending on the file type. I'm recording voice using the mic and saving it as an AAC file. When I got the information, the duration was bigger than it should be. But when I play mp3 files, I can get the sound info correctly.
Describe the bug
I put the getInfo inside SetInterval to get current Time every Second.
it return me current time and duration.
The duration is wrong that is less than the currentTime
To Reproduce
Using
Expected behavior
duration shoould be equal or bigger than the current time.
Platform (please complete the following information):
Tested on Android only.
The text was updated successfully, but these errors were encountered: