Audio Processing in Standalone App

Hi guys,

it’s me again…
After having successfully completed my first plugin, I want to built a standalone version of the filter. So I tried to set up the audio processing, similar to the plugin host demo.

I wrote a class, that inherits AudioIODeviceCallback, where I want to handle all the Midi and Audio stuff:

#include "../JuceLibraryCode/JuceHeader.h"

class AudioMidiHandler : public AudioIODeviceCallback
{
public:
	AudioMidiHandler (void);
	~AudioMidiHandler (void);

	void audioDeviceAboutToStart (AudioIODevice* device);
	void audioDeviceStopped();
    void audioDeviceIOCallback ( const float** inputChannelData, 
								 int numInputChannels,
                                 float** outputChannelData, 
								 int numOutputChannels, 
								 int numSamples );

private:
	double sampleRate;

	//==============================================================================
    // (prevent copy constructor and operator= being generated..)
	AudioMidiHandler (const AudioMidiHandler&);
    AudioMidiHandler& operator= (const AudioMidiHandler&);
};

Furthermore, I have a MainComponent and in it’s constructor, I’m setting up a new member of the AudioDeviceManager:

	audioMidiHandler = new AudioMidiHandler();
	deviceManager.initialise (2, 2, 0, true, String::empty, 0);
	deviceManager.addAudioCallback (audioMidiHandler);

In the audioIODeviceCallback method, I pass the inputChannelData to the outputChannelData. But, strangely, I don’t hear anything when playing trough my soundcard. Did I miss something?

It’s also strange, that in the “Audio Settings” (which I’ve implemented in exactly the same way as it is done in the plugin host, but without saving a XML file), in my app the “audio device type” combo box is missing.

I hope, that this is the right way, doing the audio processing in standalone apps. Would be great, if someone could give me a hint, how to make it work…

Best,
Philipp.

The easiest way to do this is to use the standalone filter window class that’s found in Juce\src\audio\plugin_client\Standalone You can also search the forum for info on using it.

Hi,

thanks for your reply. I already saw your post in this thread: http://rawmaterialsoftware.com/viewtopic.php?f=2&t=4895&hilit=plugin+to+standalone
I haven’t tried this yet, but it seems like this could be an option.

Nevertheless, it would be good to know, how to setup audio processing in standalone apps, when not using the plugin engine…

I got it. Two very stupid mistakes…