But I’ve looked through most of the DSP demo and it seems quite contrary to the tutorials.
With main.h and MainComponent.h and they contain classes of differing types, like Thumbnail and AudioPlayer.
What do these do? The helps just tells me they manage stuff:-
All I want to do is load up a file and feed it through the processing block or print the waveform in the manner I want - dynamically. edit I just saw the sample player tutorial. I presume I can make a copy of the AudioSourceChannelInfo and get whatever amount of samples I want?
What I’m really asking is how do I get at the Raw samples in float format?
That’s great thanks, I think I need a bit more patience. Juce seems overwhelming at times, but I guess I’m a grass roots kinda guy, and I like to control everything myself, rather than have overly complex code do it for me - as it can get a bit much at times. Just looking at that ‘thumbnail’ code is enough to put me off forever!
The “readFromAudioReader” example in your link is redacted - is there any other way of filling memory with sample data? It looks like that example file player is from a file and it resamples the sample rate.
Sorry, I didn’t mention that readFromAudioReader is not available anymore. The AudioFormatReaderread() is what you need. Just search the forum, there’s plenty of answers for this - here’s another thread:
I rewrote the code (but didn’t tested). Call read() and increment sourceStartSample in each iteration of processBlock by numReadSamples. Don’t forget to reset it when it goes to end, fill the rest of the outputBuffer with zeros when there’s not enough samples (or clear() at the beginning of iteration), etc.
give it an AudioFormatReaderSource, you can use the AudioFormatManager to find the AudioFormat and call createReaderFor (format)
call AudioIODevice::start (audioSourcePlayer)
I hope I could give you some entry points, what the main classes are (from my perspective). But it would exceed my possibilities, to explain the whole architecture (even if I knew it in full).
Your curiosity is much appreciated, but to give you more detail, I would need to know, what you are up to
If you are worried about performance, as far as I can tell, they try to keep it slim and performant.
if this is non-zero, it specifies the sample rate of the source, and playback will be sample-rate adjusted to maintain playback at the correct pitch. If this is 0, no sample-rate adjustment will be performed
You can obviously do that with JUCE too. If you just want to output audio into your audio hardware, it’s enough to just use the AudioDeviceManager and write an AudioIODeviceCallback subclass that delivers your buffer or a part of it into it. But it would be quite pointless to use JUCE only as a PortAudio replacement. (Unless you know the JUCE implementations for the audio hardware handling are better than what PortAudio has.)