audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

Right to left rendering of waveforms in AudioWaveforms widget

Open guplem opened this issue 2 years ago • 4 comments

Describe the bug When recording, the waveform renders the "audio lines" from left to right, like so:

[ |||| ---- ]

It does so until they reach the right side (filling the whole widget). Then, the old lines are displaced to the left and the widgets keep rendering the newest ones on the right.

Expected behavior I would expect the lines to be rendered always from right to left, looking this at the beginning:

[ ------|||| ]

And no change should happen whenever the lines reach the left end of the widget (filling the whole widget). The new lines should be placed on the right side and keep pushing old ones to the left.

You can see examples of this behaviour in many apps like WhatsApp

Screenshots This is how it behaves right now (wrong): image

This is how I expected it to behave: image

guplem avatar Sep 22 '23 10:09 guplem

@guplem I have implemented this feature. Can you please review it once and give suggestions?

manoj-simform avatar Oct 19 '23 13:10 manoj-simform

@manojSimfrom thank you very, very much for your collaboration.

Your changes work and reverse the direction of the waveforms.

However, the result is not the desired one...

This is the behavior we are looking for:

This is a representation of how the waveform should eveolve over time, from top to bottom.

image

Let me clearly explain what I am looking for:

The desired behavior is for the audio lines to always render from right to left. Now, this can be achieved with the rlt WaveDirection that you added. But, as the recording continues and more audio data is generated, the newer lines should appear on the rightmost part of the widget, progressively pushing the older lines to the left.

I encourage you to test this right-to-left rendering is consistent with user experiences in popular applications like WhatsApp.

guplem avatar Oct 19 '23 16:10 guplem

@guplem Thanks for the replay & suggestion I understand your scenario. Let me make the changes regarding the same as you asked. I will notify you once the changes are done.

manoj-simform avatar Oct 20 '23 06:10 manoj-simform