How to best play back audio from a video in Unity through FMOD

Hello community & team FMOD!

We’re trying to find the best way to play back the audio for our cutscenes (MP4 files, audio embedded) through FMOD. Video playback is handled through the Unity Video Player component, Unity audio is disabled.

Our first approach was to use the scripting example provided in the FMOD documentation.

This works, but especially on low end mobile devices (or when simply clicking on an element in the Unity Editor during playback) we get unacceptable stuttering.

From this post I understand that a better way might be to use a conventional FMOD event to play back the audio (playing back two things - video through Unity and audio through FMOD).

An alternative I thought about would be to preload the audio stream into memory before starting playback, hopefully avoiding any nasty buffer underruns.

I also thought about switching off the drift compensation in the script, or maybe a combination of preloading samples + no drift correction.

Which solution would you suggest?

Stuttering generally means buffer overruns/underruns- one of of the entities can’t keep up with the other one so samples are being discarded. Since it’s on low end devices, most likely the device can’t keep up with the FMOD System. Before digging deeper, these sorts of issues can usually be solved by increasing the DSP Buffer Length in the FMOD Unity settings for that platform.

Can you please try increasing you DSP Buffer Length (maybe double?) for your “Mobile Low” platform and see if that helps with the stuttering at all?