Reputation: 33
I am trying to create a scrolling waveform using Juce's AudioVisualiserComponent, however I can't seem to do so.
I have an AudioSampleBuffer variable called waveform and I have assigned it to the buffer of the incoming audio data
waveform = *bufferToFill.buffer;
I need to pass waveform to another class that controls the GUI that displays the waveform
AudioSampleBuffer FilePlayer::getBuffer()
{
return waveform;
}
In the GUI class I try to implement the waveform like so
addAndMakeVisible(&waveform);
waveform.pushBuffer(filePlayer.getBuffer());
waveform.setColours(Colours::black, Colours::red);
waveform.setSamplesPerBlock(256);
waveform.setBufferSize(1024);
The program works although the waveform is never visible, what am I doing wrong?
Upvotes: 0
Views: 246
Reputation: 159
Have you set the bounds of your AudioVisualiserComponent
using Component::setBounds()
?
Upvotes: 1