How to add an AudioSource based class to a MixerAudioSource

113 Views Asked by At

I’ve created a class for managing the audio of my synth:

class midiSource : public juce::AudioSource

I would like to add it to my mixer. However, the MixerAudioSource class accepts only AudioSource as input. How can I pass midiSource as an input source to my mixer? (e.g.: mixer.addInputSource(mySource, false);)

1

There are 1 best solutions below

0
Ruurd Adema On

Since juce::MixerAudioSource::addInputSource() expects a pointer to a juce::AudioSource, or a subclass of juce::AudioSource, you can just pass &mySource to addInputSource().