How to read samples from audio source?


I am very beginner for juce, I am trying to build a multi track recorder and apply effects.
Current, I faced some problems:

  1. I can not understand how to apply effect(EQ/Reverb) to a track(source node);
  2. I can not how to read the rendered audio samples to memory after apply effects.
  3. I thinking AudioProcessorGraph can help it, but can not found more examples.
  4. Can we have a class like web audio API analyserNode? I used it for solved #2.

How I would tackle this is:

  • Start an audio project
  • Apply the effects to the AudioBuffer, or possibly wrap it in a dsp::AudioBlock in the process audio callback.
  • Use JUCE: AudioFormatWriter::ThreadedWriter Class Reference to get the data from the audio thread over to the writer which should run on it’s own thread to avoid glitches.

I’m not sure I’d use AudioProcessorGraph unless I really needed to do something complicated.

Are you new to JUCE, DSP and C++ or just JUCE?

just JUCE beginner.

I’m confused about the audioDeviceIOCallback, I thought it was working globally, obviously if it was I wouldn’t have a way to listen to a particular track individually.

Suppose we now have Track A,B,C,D

A is connected to Effect 1
B connected to Effect 2 , Effect 3
C D is not connected any effects.

So how should I get the Samples of Track A B C D after rendering in a generic way?

In the Web Audio API, we always connect an AnalyserNode at the end, and we can use getFloatTimeDomainData() to get the data.

If you have say 8 tracks coming in they’ll be all in teh same block. You’d need some kind of mapping so you know which channels are associated with each track I guess.

Now personally I’d probably write custom code from there. Maybe there’s a way of splitting the channels up and feeding them into AudioProcessorGraph though. I would look at the AudioPluginHost demo code which I think handles all this!

Thanks! i already checked the plugin(AudioProcessor) examples, looks like it’s work.

#1. the function process(buffer,size) received input data from prev audio source, right? so, I can cache it on myself audioprocessor subclass after processed for solve question #2.

the question is all of examples are GUI demo, I am not sure how to directly use AudioProcessor as a node.

I’m not sure I understand your english here?

sorry for my English, let me draft some code first, talk then.

1 Like