Audio File Operations


I haven’t had any experience with programming using audio file I/O and manipulations and I was wondering what sequence of operations are needed in order to open an audio file (from what i’ve read a .wav file), and be able to apply effects to that file using a 3rd party plugin. I already have the steinberg VST SDK, I have the plugin downloaded onto my computer, and I have downloaded the most recent version of juce. Searching through the juce library hasn’t been too productive however.

Thanks in advance


Have a look at the Plugin Host example in the “extras/audio plugin host” folder. It uses an AudioProcessorGraph which allows you load up and connect plugins together. To be able to load the VST’s you’ll need to make sure the project can find the VST SDK. The default for the Plugin Host is set to c:\SDKs\vstsdk2.4 on windows and ~/SDKs/vstsdk2.4 on mac.

To run the audio from the file through the graph you will need to create a plugin of your own. It doesn’t need to be a VST, it can be just an internal plugin using the AudioPluginInstance class. Your internal plugin can use an AudioTransportSource to read the file. Have a look at the Juce Demo’s file playback demo to find out about using one of these.

In general, pay attention to the processBlock method of AudioPluginInstance (actually it’s from AudioProcessor which AudioPluginInstance is a subclass of). The AudioProcessorGraph is actually an AudioProcessor itself and in it’s processBlock it calls the processBlock methods of each plugin in the graph. In your internal plugin the processBlock method will be where you call getNextAudioBlock on your AudioTransportSource. processBlock accepts an AudioSampleBuffer and the AudioTransportSource needs an AudioSourceChannelInfo. So you will have to convert between these.

It’s certainly a bit involved if you’re new to it but that’s basically what you want to do.


Thank you for your information,

please guide about automation of operations with your audio files.