the waveform display is working… currently it’s only doing mono because I wasn’t sure if ya’ll wanted two waveforms for stereo or mearly left/right or both… or… or… uhhh… heh :roll: :shock:
It resizes and all that good stuff too… there is a bug with the transparencies. For whatever reason, it goes very light if I try to keep the transparency on (I happen to like the solid color better tho… my laptop cpu like it much better too). Probably some secret niggles in there, or someone will jump in and rant that my code sucks… heheheh.
BTW, I abandoned the wavereader class idea… because it really doesn’t take that many steps to implement loading a buffer and that what not… or getting the sample values from the buffer, etc. Maybe I’m missing the point (then again it’s hella late… I mean early, and I need sleeeeep).
I attached bithead’s waveplayer class on here too… it’s commented out because Robert has it read a wav too… so I dunno which one is going to end up being the primary one… so they are both in there…
OK here’s my attempt at waveform display and editor classes for audio files (rather than audio buffers at the moment). Still rough but a basic infrastructure is in place.
Well yes and no. I hadn’t found the AudioThumbnail class although having found the thread on the forum I now remember seeing it. I’ll look at refactoring using the class. But I do want to customise the drawing in the future but I guess I could just subclass it and override the paint() method.
I didn’t look well enough but your waveform surely looks sharp
Although we had some crashes, which at the moment i can’t recall when those happened. We are using the AudioThumbnail together with the ThumbnailCache class from Juce but it’s quite buggy in our app at the moment. So this looks like a nice alternative.
for some reason (not having looked at the classes) i assumed that ‘AudioThumbnail’ was like some custom-length preview of an audio file with fade-in/out applied (and so didn’t bother investigating). It literally never occurred to me that it generated a waveform!
…and I was hoping my method would allow channels > 2 but I notice that AiffAudioFormatReader and WavAudioFormatReader only do mono/stereo so that doesn’t work anyway!
Ultimately I want to be able to read/write markers and loop points from/to an AIFF/WAVE file from my waveform editor class. I’ve hacked away at my copy of juce_AiffAudioFormat.cpp to get at INST and MARK chunks but only as far as posting them in the console. I remember something about this in another thread. Jules, have you plan to deal with these chunks? I remember you were concerned they may contain large amounts of data and were reluctant to load them all into memory.
[quote=“gekkie100”]
Although we had some crashes, which at the moment i can’t recall when those happened.[/quote]
It needs checking for threadsafeness but it was crashing occasionally in the MyWaveformMultiDisplay::fillBuffers() method when changing the horizontal zoom. That should be fixed now.