SimformSolutionsPvtLtd / audio_waveforms

Use this plugin to generate waveforms while recording audio in any file formats supported by given encoders or from audio files. We can use gestures to scroll through the waveforms or seek to any position while playing audio and also style waveforms
https://pub.dev/packages/audio_waveforms
MIT License
280 stars 146 forks source link

Can fix wave max length width when Record? #91

Open brainer3220 opened 2 years ago

brainer3220 commented 2 years ago

Example code is when recording not fixed wavelength and allow move to gesture.

But, I want fix specific max wavelength(ex. millisecond unit).

Can available?

ujas-m-simformsolutions commented 2 years ago

If I understood you correctly you want to fix the recording time of the audio recorder, if yes then you can just create a Duration instance and wait for it. After it completes just stop the recorder.

brainer3220 commented 2 years ago

@ujas-m-simformsolutions Thank you for response.

I want not only fix recording time, but also fix Waveform max length.

For example expended waveform when record more then certain time length, but I want don't expend waveform but weveform length by percentage.

ujas-m-simformsolutions commented 2 years ago

I think you want the fixed number of waves shown on the screen and when the user uses the mic all the fixed number of waves should react to it, right?

brainer3220 commented 2 years ago

@ujas-m-simformsolutions IMAGE 2022-09-07 00:03:14

Um.. No, just set max wave form length. (Allow early stop)

ujas-m-simformsolutions commented 2 years ago

The current default implementation for recording waves is they start from the middle of the provided width so you want the full width if yes then in WaveStyle there is a parameter extendWaveform if you provide true then waveforms will take the full provided width.

brainer3220 commented 2 years ago

@ujas-m-simformsolutions Yes, I know.

But a few seconds later, waveforms move to left.

I think set compressed num(?) when finish the record.

If have two different time length audio files.

I want the waveform length to be different, but currently the same.

ujas-m-simformsolutions commented 2 years ago

so you want a custom middle line position. Where waveforms shouldn't pass that custom-provided offset which is right now size.width/2 if extendWaveform isn't set to true.

brainer3220 commented 2 years ago

@ujas-m-simformsolutions I think Yes.