System::init

FMOD Studio API

Firelight Technologies FMOD Studio API

System::init

Initializes the system object, and the sound device. This has to be called at the start of the user's program.
You must create a system object with FMOD::System_create.

C++ Syntax

FMOD_RESULT System::init(
  int maxchannels,
  FMOD_INITFLAGS flags,
  void *extradriverdata
);

C Syntax

FMOD_RESULT FMOD_System_Init(
  FMOD_SYSTEM *system,
  int maxchannels,
  FMOD_INITFLAGS flags,
  void *extradriverdata
);

C# Syntax

RESULT System.init(
  int maxchannels,
  INITFLAGS flags,
  IntPtr extradriverdata
);

JavaScript Syntax

System.init(
  maxchannels,                     
  flags,                           
  extradriverdata                  
);

Parameters

maxchannels
The maximum number of channels to be used in FMOD. They are also called 'virtual channels' as you can play as many of these as you want, even if you only have a small number of software voices. See remarks for more.
flags
See FMOD_INITFLAGS. This can be a selection of flags bitwise OR'ed together to change the behaviour of FMOD at initialization time.
extradriverdata
Driver specific data that can be passed to the output plugin. For example the filename for the wav writer plugin. See FMOD_OUTPUTTYPE for what each output mode might take here. Optional. Specify 0 or NULL to ignore.

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

Virtual channels.
These types of voices are the ones you work with using the FMOD::Channel API. The advantage of virtual channels are, unlike older versions of FMOD, you can now play as many sounds as you like without fear of ever running out of voices, or playsound failing. You can also avoid 'channel stealing' if you specify enough virtual voices.

As an example, you can play 1000 sounds at once, even on a 32 channel soundcard.

FMOD will only play the most important/closest/loudest (determined by volume/distance/geometry and priority settings) voices, and the other 968 voices will be virtualized without expense to the CPU. The voice's cursor positions are updated.

When the priority of sounds change or emulated sounds get louder than audible ones, they will swap the actual voice resource over and play the voice from its correct position in time as it should be heard.

What this means is you can play all 1000 sounds, if they are scattered around the game world, and as you move around the world you will hear the closest or most important 32, and they will automatically swap in and out as you move.

Currently the maximum channel limit is 4093.

See Also




Version 1.10.03 Built on Feb 1, 2018