-
Notifications
You must be signed in to change notification settings - Fork 42
feat: add progress to onCurrentRecordingWaveformData listener #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@DanielFRico Thank you for your valueble contribution to this library. We will test this internally and let you know if this needs any modification or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielFRico Can you please update Readme file to include progress value in callback ?
|
@DanielFRico This functionality works properly on both iOS and Android. We should include a callback prop to transmit the updated time duration to the waveform component, similar to the process we use for static waveforms. For static waveforms, we have a property named
useEffect(() => {
if (!isNil(onCurrentProgressChange)) {
(onCurrentProgressChange as Function)(currentProgress, songDuration);
}
}, [currentProgress, songDuration, onCurrentProgressChange]);
const tracePlaybackValue = onCurrentDuration(data => {
if (data.playerKey === `PlayerFor${path}`) {
const currentAudioDuration = Number(data.currentDuration);
if (!isNaN(currentAudioDuration)) {
setCurrentProgress(currentAudioDuration);
} else {
setCurrentProgress(0);
}
}
});Let me know your thoughts on this. |
|
@DanielFRico Upon further testing, we found that this approach would be difficult to manage for implementing resume and pause recording, as it currently only accounts for To handle this properly, we need to consider scenarios where users utilize Let us know your thoughts—should we proceed with refining this implementation, or would it be better to close this PR for now? |
@kuldip-simform You're completely right! I've added your suggestion in latest commit |
@DanielFRico Can you please check this comment? also can you please take a pull or rebase your branch with the latest develop branch as we have merged some code? |
cecd01b to
ac4e82a
Compare
@kuldip-simform done! |
|
@kuldip-simform I've added some changes to support what you said. I made test both iOS and Android and progress value now is sync also with events like pause and resume |
|
@DanielFRico Thank you for updating the PR. While testing the pause and resume functionality, I noticed a mismatch between the actual recording duration and the duration calculated in your implementation. Specifically, the time reported at stop differs from the duration retrieved using asset.duration. Additionally, if pause and resume actions are performed in quick succession, the mismatch tends to increase significantly. Could you please investigate this issue? You can compare the calculated duration at stop time with asset.duration to identify any discrepancies. I’ve also attached a video for further context. Thanks! Screen.Recording.2025-02-25.at.2.mp4 |
@kuldip-simform my first idea was to get currentProgress inside timers. But I found some complications. What do you think? is it possible to get current audio recording duration in that point to get a more accurate value? |
|
@DanielFRico |
@kuldip-simform in my opinion I suggest to send this implementation is not perfect but it will add a value for users. Of course, changes and improvements will appear but al least we will have a base of code to make refactors. |
|
@DanielFRico Following internal discussions, we’ve determined that any feature we introduce should aim for a high degree of accuracy to ensure the best possible experience for end users. While this implementation certainly offers value, we feel that it does not yet meet the precision standard we aim for. With that in mind, we’ve decided to keep this PR open for now. This will allow us to gather additional insights, explore potential refinements, and evaluate alternative solutions that could enhance the implementation. If we identify a more precise approach—either from further team discussions or new suggestions—we will revisit and improve this accordingly. Once again, thank you for your contributions. We appreciate your dedication and look forward to refining this feature together. |
|
+1. Really need this. Currently I am using modified lib with patches to get the real-time duration. |
Hi, team! I would you add next feature to onCurrentRecordingWaveformData listener. In my opinion its useful if user wants to know current recorded time. In our case to displayed how long time is being recorded in real time. Regards!