audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

seekTo(progress) is not working

Open VivekMakwana24 opened this issue 3 years ago • 7 comments

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

VivekMakwana24 avatar Sep 23 '22 15:09 VivekMakwana24

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

Ujas-Majithiya avatar Sep 25 '22 09:09 Ujas-Majithiya

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 Screenshot from 2022-09-26 12-33-24

2] These are the logs of the duration I am passing in the seekTo methhd Screenshot from 2022-09-26 12-23-08

3] This is the AudioFileWaveforms implementation Screenshot from 2022-09-26 12-44-36

`

Please let me know if you need anything else.

Thanks

VivekMakwana24 avatar Sep 26 '22 07:09 VivekMakwana24

@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 avatar Sep 27 '22 04:09 ujas-m-simformsolutions

@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 avatar Sep 27 '22 05:09 VivekMakwana24

@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.

ujas-m-simformsolutions avatar Sep 27 '22 13:09 ujas-m-simformsolutions

Okk, Is there any solution that you would propose?

VivekMakwana24 avatar Sep 30 '22 10:09 VivekMakwana24

@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.

ujas-m-simformsolutions avatar Oct 12 '22 09:10 ujas-m-simformsolutions

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.

ujas-m-simformsolutions avatar Nov 30 '22 13:11 ujas-m-simformsolutions