Pausing and Resuming Recording

Hi,
I’m using CoreSystem.recordStart and recordStop to record the users’ microphone into a sound object.
Now when the game is paused I wanna pause the recording and on unpause resume the recording.

Can I somehow continue recording into the same sound object? I haven’t been able to find a suitable method for this.

Presuming you have released your existing Sound you will need to go through the process of calling System::createSound and System::recordStart on the sound again.

So if I wanna replay the whole recording later (without the pause), I probably gotta keep multiple Sounds around and then replay them one after the other?

I think that is a good solution. You could potentially pause the mixer with System::mixerSuspend and resume it again with System::mixerResume to have an unbroken recording, but that would stop all audio in the system while it’s paused.

So I finally got around to implementing it, what I ended up doing for anyone that might come across that thread later:

  • Preallocate a bunch of sound objects
  • Record into a sound object
  • If the game is paused, stop recording, save how much was recorded of the sound with CoreSystem.getRecordPosition and use a new sound object to record into once the game is unpaused.
  • When replaying I check the current position of the channel with channel.getPosition and compare that to the saved length. If I’m over the length I stop playing this one and select the next sound object to play.
1 Like