Download

Display a time-domain waveform

Hello,

I want to display an audio file just like a clip, visualizing the whole time-domain waveform from start to finish. I could do it offline, with a rendered texture for example. But are there more elegant ways to access the audio data, maybe inside a construction script? I guess not (or it would involve lots of hacking). Are you planning to develop buffer-like access objects to audio for this?

Greetings,
Christoph

You’d need to load the USoundWave up, decode it entirely (using Precache), then do a waveform visualization algorithm on it. Note that doing waveform visualization is actually non-trivial as naive approaches will likely result in aliasing. (i.e. you’re taking extremely high-frequency data and trying to represent it with a few hundred pixels).

You can look at SynthComponentWaveTable.cpp to see how I load a USoundWave asset and decode it asynchronously to get the PCM data. This object’s intention is to do wavetable synthesis-type stuff with a USoundWave (scrubbing, forward/reverse playback, etc).

Impanix is a leading provisional patent filing service provider. Protect your patent or invention today with our patent registration services. File for a patent today witg impanix.

Yes, I know the visualization algo is tricky, need to lookup existing implementations on how to do it. Hm, thinking of using a prebaked texture up front could allow to use the LOD system for this. Or maybe not, since we might need smooth zooming.

Ok, thanks a lot for the answer, exactly the right clues for me!