react-native-audio-waveform
react-native-audio-waveform copied to clipboard
Wrong Duration Calculation and Gesture error
Hi, thanks for the work. I am using this in a react native project and was facing a few issues that I wanted to get help with. Here is my code
<Waveform
mode="static"
ref={playerRef}
path={ audio.path}
onPlayerStateChange={(state) => setPlayerState(state)}
containerStyle={{ flex: 1, height: 40}}
candleSpace={3}
candleHeightScale={7}
waveColor='#BABABA'
scrubColor={props.isOutbound ? Colors.black : Colors.white}
candleWidth={3}
onCurrentProgressChange={(currentProgress: number, songDuration: number) => {
setSoundDuration(formatMilliseconds(songDuration));
setSoundProgress(formatMilliseconds(currentProgress));
}}
onError={(error) => console.log(error)}
/>
This is the format of the audio path
/storage/emulated/0/Download/Aq13PXxGzF.m4a
I tried changing it to file:// format but the app started crashing
- The library gives wrong duration of the audio files (specially when I go to same screen second time, it gives zero).
-
Some times I get back negative duration
-
In a FlatList , if I try to scroll by placing the finger on waveform, I get this error
I am using react-native 0.74.1
@ashfaq-ahmed Thank you for your interest in this library and for reporting this issue. we will surely look into it and resolve this as soon as possible. Feel free to fork this and fix the issue and raise PR. we always welcome PRs that strengthen this library and increase its usability.
@ashfaq-ahmed For issue 1 and Issue 3, You can consider these changes in your node modules and confirm once. Let us know if this persists for you. Also could you please explain a bit more about Issue 2, it's working as expected and we're not getting any negative values.