Recording in-game audio for in-game playback

Hi All - might be a bit of a dumb question, but I was looking at integrating FMOD in place of Unity’s native AudioListener/AudioSource system, however for the purposes of game mechanics I need the ability to record audio as it’s happening in scene and play it back at a later stage. At the moment, I’m writing audio that the AudioListener is picking up to a file stored in the Unity Assets folder, updating that during playback, and then playing this when needed and I’m hoping to replicate this as best I can with FMOD - I’m assuming this is possible, but any pointers as to how best to do this? Or is it really as simple as a one-to-one swap in and out of the Unity Listener and FMOD’s Listener? Thanks!

It is not as simple as a one-to-one swap, but you can record in-game FMOD audio by implementing a DSP_READCALLBACK. We have a Unity DSP Capture example which should be a good starting point. You can copy the raw data from the inbuffer and save it to a file, and then play it back later by writing the saved data to the outbuffer.