plotting a waveform

Started by LordAdef,

LordAdef

Hello everyone,

I'm sure this is a usual question..

...but would a good soul give me a code to draw the waveform?

Ian @ un4seen

The SPECTRUM.C and LIVESPEC.C examples included in the BASS package have a waveform display mode. They're pretty basic with no zooming, but could give you some ideas. If you do want to zoom-out then you would combine multiple samples per pixel (eg. draw a line between the low and high peaks).

LordAdef

Quote from: Ian @ un4seenThe SPECTRUM.C and LIVESPEC.C examples included in the BASS package have a waveform display mode. They're pretty basic with no zooming, but could give you some ideas. If you do want to zoom-out then you would combine multiple samples per pixel (eg. draw a line between the low and high peaks).

Thanks Ian. I will check it out. Out of curiosity... I want to plot the whole wav file prior to playing it. Can I use the examples you mentioned to achieve that? One last question, sorry, is it post decoding?

Working on your library.

Ian @ un4seen

If you just want a display of the entire file then you could instead have a look at the CUSTLOOP.C example, which uses BASS_ChannelGetLevelEx to generate such a display. It isn't strictly showing the waveform but rather stereo peak levels (left above and right below).