ryanheise / just_waveform

A Flutter plugin to extract waveform data from an audio file suitable for visual rendering.
MIT License
86 stars 17 forks source link

how to implements a proper WaveformZoom? #34

Open liujian-930212 opened 6 months ago

liujian-930212 commented 6 months ago

Hi there,

I was wondering how can I evaluate a proper zoom value? Sometimes, I dont need that accurate wave such as pixelsPerSecond(100). Even 2 to 3 pixelsPerSecond is enough for me. But it extracts a null waveform. Well, if the audio is long enough, it works.

Thanks

ryanheise commented 6 months ago

If you imagine the lowest number of oscillations per second that a human can actually hear (20 Hz), you would need more than 20 pixels per second to actually see the "wave", so 2-3 pixels per second is a bit outside the expected range of normal usage. I suppose you don't care about the wave, you only care about the amplitude? In which case are you just trying to visualize the volume of the audio?

What is the lowest pixels per second that works?

liujian-930212 commented 6 months ago

@ryanheise Thanks for the quick respond.

I was trying to figure out the lowest pixels per second because I noticed that a low pps may cause a null waveform, so I am not sure the pps I'm using is always big enough for a certain audio file.