Live Recording the audio output of a bus and export file afterwards

Hey everyone,

I am working on a mobile library that records MIDI notes and plays them into a sampler. The sampler outputs goes through some effects and finally to an output bus.

I want to try to add a feature to live record the output of the bus for saving and sharing later.

What is the right approach to this and the right JUCE components to use?

Thanks in advance!