Is there a way to only record audio using Unity Recorder?

I’m trying to record an uncompressed image sequence, but I still need the sound. If I record an mp4, the image is compressed, but with sound. If I record an png sequence, the image doesn’t lose quality, but there’s no sound. My current solution is to record a low resolution mp4 in addition to the png sequence, but considering the existing performance problems (see this thread ), that’s not an ideal solution.

Is an audio-only recorder planned or is there another (performant) way to do it?

Hey @any_user ,

So having a proper Audio-only Recording is a little bit of work but definitively on the road map.

That said a proof of concept alternative is now available on our very new film-tv-toolbox repository :

The idea is to integrate this properly into Recorder. But in the meantime, it will probably help some people out.

Let me know if you have any issue with this,

Thanks a bunch for your patience !

1 Like

I finally had time to try this out. This is exactly what I was looking for, thanks!

It works well, except that recording multichannel (more than stereo) output was is not completely implemented in the WavEncoder. I made a small modification to fix that:

What I had to figure out:

  • The recording sample rate can’t be selected in the editor. And setting the editor sample rate in the Unity Audio settings doesn’t work, because it seems to be controlled by the sound driver directly. To record with 48khz sample rate I had to switch my system settings (audio midi setup on macOS), then it worked.

  • Multichannel recording only works if the sound driver supports the required output channel count. If I record with 5.1 speaker mode in the Unity Settings, but with a stereo audio device selected, there’s not enough data generated for all the channels. In this case it still records (with my modification) a 6 channel wav file, but the wave data is still only stereo, which results in a high-pitched “broken” file. If the sound device supports enough channels, the recording is done properly. For example, with soundflower 64 channel output it works to record a 6 channel (5.1) file.

Two questions, possibly connected to each other:

  • Is there a way to detect for how many channels the audio data is generated? I thought AudioSettings.driverCapabilities should do that, but it didn’t seem to return any useful results (for example it said my builting macbook stereo output is 5.1 compatible, which it isn’t).

  • Is it fully supported to switch the audio output device while the editor is running? I’ve had problems with enabling a multichannel output (soundflower 64ch) while unity was running. I had to restart the editor to make it work properly.

1 Like