Answered
2
0

I’m testing the delay on sound playing. I’m using the same wav file (mono sine tone, 0.5sec, FADPCM, 24KHz, 3.2KB), and created two events, one with streaming and one with decompressed in memory. I recorded the video using iPad Pro built-in recorder and measure the visual/sound delay using Final Cut. The game is running at 30fps. Here’s the result:

System | Decompressed | Streaming |
Fmod Designer | 2~3 frames | 2~3 frames |
Fmod Studio | 4~5 frames | 8~9 frames |

It’s surprising to see that Fmod Studio’s streaming has a 4 frames more delay than it’s decompressed mode, while Fmod Designer’s streaming has no observable delay comparing to decompressed. Is there any reason for such longer delay? Does Fmod Studio have a different implementation on streaming? And is there any advice on how I could reduce the streaming delay?

Thanks,

  • You must to post comments
Best Answer
0
0

FMOD::Studio::EventInstance::setProperty(FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY, 0) solves the problem for my specific case, where iOS device takes ~4ms to load the streaming assets, and takes around 20ms to start them. If it takes longer to load, the scheduled delay number might need to be tweaked to larger value.

  • You must to post comments
1
0

I can reproduce the delay in Fmod Studio by using the sample app. Here’s the video:

https://drive.google.com/file/d/1b0owpRFZPyse9JmVQKlpdZ62E7s1-q5s/view?usp=sharing

The delay between the button highlighted to the sound played is around 4 frames for non streaming (Button A) and ~10 frames for streaming (Button B).

The code is here
https://github.com/wandermyz/FmodStudioTest/blob/master/simple_event.cpp

  • You must to post comments
1
0

Designer would prebuffer streams for immediate playback, however since Studio is more dynamic it loads streams on demand (with look ahead) and adds latency to hide the loading time. There is a fixed latency (schedule delay) that all events with streams have, this handles streams that play at time=0 on the event. Once running, the event has an extra look ahead time to spot additional streams and start loading them.

  • Yang Liu

    Is this fixed latency configurable?
    What I found is that on my iPad Pro, loading a small sound may only take 5ms, however the latency since the sample loaded and the mixer processes could be as large as 300ms. It seems the latency is still quite large on iOS, considering it has really fast IO reading.

  • Cameron Baron

    Currently it isn’t configurable, we do have a task to investigate if this is something we can expose but there isn’t any clear date at this point.

  • You must to post comments
0
0

Thank you for sharing that Yang Liu, now i understand why i had some problems with sync.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.