audio_waveforms
audio_waveforms copied to clipboard
seekTo(progress) is not working
Hello,
seekTo function is not working, Could you please check?
This is how I have used it
_currentPlayerController?.seekTo(Duration(seconds: double.parse(p0).truncate()).inMilliseconds);
Thanks
Hey @VivekMakwana24, Here are some cases seekTo won't work
- Negative duration
- Controller not initialized
- Audio is paused
If it's none of the above can you share your implementation
Hello, @Ujas-Majithiya
Thanks for quick reply,
As per your mentioned points, all cases are correct.
Let me share some screenshots for the implementation
`
1] This is how I am performing seekTo() operation

2] These are the logs of the duration I am passing in the seekTo methhd

3] This is the AudioFileWaveforms implementation

`
Please let me know if you need anything else.
Thanks
@VivekMakwana24 The image of the code you have provided looks ok to me so it will require minimum reproducible code or your platform specification because with the example app it is not reproducible.
@ujas-m-simformsolutions
I have tried my implementation with the example app,
I am checking on Android device Device Info :
- OnePlus 9R (Android 12)
The issue I found is when in my example I am using "..androidOutputFormat = AndroidOutputFormat.aac_adts" for recordController.
.androidOutputFormat = AndroidOutputFormat.mpeg -> Works Fine
.androidOutputFormat = AndroidOutputFormat.aac_adts -> Creates issue while performing seekTo
@VivekMakwana24 This plugin uses ExoPlayer to play audio on android. Now, some files won't be seekable due to this. So your file might not contain a constant bitrate or metadata for seeking.
Okk, Is there any solution that you would propose?
@VivekMakwana24 I would suggest just using the audio format which works for you and if the default format doesn't work then try using 48k bitRate and 44.1k sample rate and if you find any solution then we are open for PR.
Closing this issue since provided audio doesn't have seek-able data.
If you think this a mistake then feel free to create a new issue.