Hi,
I am new to JUCE and am trying to understand how to use JUCE to capture audio from an input device(microphone, guitar via digital audio box etc.) and playback in realtime to an output device (speaker etc.)
To start with I am trying to do this from a console application.
So far I have an AudioApp class that accepts two audio device manager instances, corresponding to the input and output audio devices.
How do then connect the input device to the output device in realtime?
Do I have to use the addAudioCallback method?
_inputDeviceManager.addAudioCallback(&this->_audioSourcePlayer)
#ifndef h_App
#define h_App
#include <JuceHeader.h>
/**
* This is the entrypoint console app
* It has-a
* AudioDeviceManager
* AudioProcessorPlayer
* AudioProcessorGraph
*
* The dumpInfo method outputs audio device setup to console
*/
class AudioApp
{
public:
/** Initialise audio device manager */
AudioApp(juce::AudioDeviceManager &deviceManager, juce::AudioDeviceManager &output);
/** Deconstructor */
~AudioApp();
/** Dump audio setup info to the console */
void dumpInfo();
/** Stream audio from input device to output device */
void play();
private:
juce::AudioDeviceManager &_deviceManager;
juce::AudioDeviceManager &_outputDeviceManager;
juce::AudioSourcePlayer _audioSourcePlayer;
JUCE_DECLARE_NON_COPYABLE(AudioApp)
};
#endif