FMOD Engine User Manual 2.03

4. Platform Details | Mac

macOS Specific Starter Guide

SDK Version

FMOD is compiled using the following tools.

Compatibility

FMOD supports x86_64 and arm64 back to macOS 10.13. Please note that both x86 and PPC are not accepted for submission to the Mac App Store and thus are no longer supported by FMOD.

Libraries

Core API library

Studio API library (used in conjunction with the Core API library)

Latency

The default latency introduced by FMOD for this platform is 4 blocks of 512 samples at a sample rate of 48 kHz, which equates to approximately 43 ms. You are free to change this using two APIs, System::setDSPBufferSize and System::setSoftwareFormat but there are some important considerations.

All audio devices have a number of samples they prefer to operate in, on Mac this is almost always 512, which makes our default a natural fit. If you use System::setDSPBufferSize to reduce FMODs granularity (to 256 samples for instance), be aware the audio device will still operate at its native block of 512 samples. If you would like to reduce the block size of the audio device (to 256 samples), after you have set the FMOD granularity and initialized the System object use the following code:

AudioUnit audioUnit;
gSystem->getOutputHandle((void **)&audioUnit);

AudioDeviceID audioDeviceID;
UInt32 audioDeviceIDSize = sizeof(audioDeviceID);
AudioUnitGetProperty(audioUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &audioDeviceID, &audioDeviceIDSize);

UInt32 bufferFrameSize = 256;
AudioDeviceSetProperty(audioDeviceID, NULL, 0, FALSE, kAudioDevicePropertyBufferFrameSize, sizeof(bufferFrameSize), &bufferFrameSize);

Suspend in Background

FMOD native threads will continue running when your application transitions to the background, this will continue to use resources. To completely stop FMOD without losing your current setup you can call System::mixerSuspend as part of your backgrounding process. When you return to the foreground, use System::mixerResume to reactivate FMOD. It is extremely important to ensure no FMOD APIs are called in-between suspend and resume as they run the risk of causing a deadlock. You must also call suspend and resume pairs on the same thread.

Thread Affinity

All threads will default to FMOD_THREAD_AFFINITY_CORE_ALL, it is not currently possible to override this with Thread_SetAttributes.

Thread Priority

The relationship between FMOD platform agnostic thread priority and the platform specific values is as follows:

Performance Reference

This section is a companion for the CPU Performance white paper and serves as a quick reference of facts targeting this platform.

Format Choice

Each compression format provided in FMOD has a reason for being included, the below list will detail our recommendations for this platform. Formats listed as primary are considering the best choice, secondary formats should only be considered if the primary doesn't satisfy your requirements.

Channel Count

To give developers an idea about the costs of a particular format we provide synthetic benchmark results. These results are based on simple usage of the Studio API using recommended configuration settings.

Settings

Test Device

Results