FMOD_MODE

FMOD Studio API

Firelight Technologies FMOD Studio API

FMOD_MODE

Sound description bitfields, bitwise OR them together for loading and describing sounds.

By default a sound will open as a static sound that is decompressed fully into memory to PCM. (ie equivalent of FMOD_CREATESAMPLE)
To have a sound stream instead, use FMOD_CREATESTREAM, or use the wrapper function System::createStream.
Some opening modes (ie FMOD_OPENUSER, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT, FMOD_OPENRAW) will need extra information.
This can be provided using the FMOD_CREATESOUNDEXINFO structure.
Specifying FMOD_OPENMEMORY_POINT will POINT to your memory rather allocating its own sound buffers and duplicating it internally.
This means you cannot free the memory while FMOD is using it, until after Sound::release is called. With FMOD_OPENMEMORY_POINT, for PCM formats, only WAV, FSB, and RAW are supported. For compressed formats, only those formats supported by FMOD_CREATECOMPRESSEDSAMPLE are supported.
With FMOD_OPENMEMORY_POINT and FMOD_OPENRAW or PCM, if using them together, note that you must pad the data on each side by 16 bytes. This is so fmod can modify the ends of the data for looping/interpolation/mixing purposes. If a wav file, you will need to insert silence, and then reset loop points to stop the playback from playing that silence.

Xbox 360 memory On Xbox 360 Specifying FMOD_OPENMEMORY_POINT to a virtual memory address will cause FMOD_ERR_INVALID_ADDRESS to be returned. Use physical memory only for this functionality.

FMOD_LOWMEM is used on a sound if you want to minimize the memory overhead, by having FMOD not allocate memory for certain features that are not likely to be used in a game environment. These are :
1. Sound::getName functionality is removed. 256 bytes per sound is saved.

C/C++ Syntax

#define FMOD_DEFAULT 0x00000000
#define FMOD_LOOP_OFF 0x00000001
#define FMOD_LOOP_NORMAL 0x00000002
#define FMOD_LOOP_BIDI 0x00000004
#define FMOD_2D 0x00000008
#define FMOD_3D 0x00000010
#define FMOD_CREATESTREAM 0x00000080
#define FMOD_CREATESAMPLE 0x00000100
#define FMOD_CREATECOMPRESSEDSAMPLE 0x00000200
#define FMOD_OPENUSER 0x00000400
#define FMOD_OPENMEMORY 0x00000800
#define FMOD_OPENMEMORY_POINT 0x10000000
#define FMOD_OPENRAW 0x00001000
#define FMOD_OPENONLY 0x00002000
#define FMOD_ACCURATETIME 0x00004000
#define FMOD_MPEGSEARCH 0x00008000
#define FMOD_NONBLOCKING 0x00010000
#define FMOD_UNIQUE 0x00020000
#define FMOD_3D_HEADRELATIVE 0x00040000
#define FMOD_3D_WORLDRELATIVE 0x00080000
#define FMOD_3D_INVERSEROLLOFF 0x00100000
#define FMOD_3D_LINEARROLLOFF 0x00200000
#define FMOD_3D_LINEARSQUAREROLLOFF 0x00400000
#define FMOD_3D_INVERSETAPEREDROLLOFF 0x00800000
#define FMOD_3D_CUSTOMROLLOFF 0x04000000
#define FMOD_3D_IGNOREGEOMETRY 0x40000000
#define FMOD_IGNORETAGS 0x02000000
#define FMOD_LOWMEM 0x08000000
#define FMOD_LOADSECONDARYRAM 0x20000000
#define FMOD_VIRTUAL_PLAYFROMSTART 0x80000000

JavaScript Syntax

FMOD.DEFAULT
FMOD.LOOP_OFF
FMOD.LOOP_NORMAL
FMOD.LOOP_BIDI
FMOD._2D
FMOD._3D
FMOD.CREATESTREAM
FMOD.CREATESAMPLE
FMOD.CREATECOMPRESSEDSAMPLE
FMOD.OPENUSER
FMOD.OPENMEMORY
FMOD.OPENMEMORY_POINT
FMOD.OPENRAW
FMOD.OPENONLY
FMOD.ACCURATETIME
FMOD.MPEGSEARCH
FMOD.NONBLOCKING
FMOD.UNIQUE
FMOD._3D_HEADRELATIVE
FMOD._3D_WORLDRELATIVE
FMOD._3D_INVERSEROLLOFF
FMOD._3D_LINEARROLLOFF
FMOD._3D_LINEARSQUAREROLLOFF
FMOD._3D_INVERSETAPEREDROLLOFF
FMOD._3D_CUSTOMROLLOFF
FMOD._3D_IGNOREGEOMETRY
FMOD.IGNORETAGS
FMOD.LOWMEM
FMOD.LOADSECONDARYRAM
FMOD.VIRTUAL_PLAYFROMSTART

Values

FMOD_DEFAULT

Default for all modes listed below. FMOD_LOOP_OFF, FMOD_2D, FMOD_3D_WORLDRELATIVE, FMOD_3D_INVERSEROLLOFF

FMOD_LOOP_OFF

For non looping sounds. (DEFAULT). Overrides FMOD_LOOP_NORMAL / FMOD_LOOP_BIDI.

FMOD_LOOP_NORMAL

For forward looping sounds.

FMOD_LOOP_BIDI

For bidirectional looping sounds. (only works on software mixed static sounds).

FMOD_2D

Ignores any 3d processing. (DEFAULT).

FMOD_3D

Makes the sound positionable in 3D. Overrides FMOD_2D.

FMOD_CREATESTREAM

Decompress at runtime, streaming from the source provided (ie from disk). Overrides FMOD_CREATESAMPLE and FMOD_CREATECOMPRESSEDSAMPLE. Note a stream can only be played once at a time due to a stream only having 1 stream buffer and file handle. Open multiple streams to have them play concurrently.

FMOD_CREATESAMPLE

Decompress at loadtime, decompressing or decoding whole file into memory as the target sample format (ie PCM). Fastest for playback and most flexible.

FMOD_CREATECOMPRESSEDSAMPLE

Load MP2/MP3/FADPCM/IMAADPCM/Vorbis/AT9 or XMA into memory and leave it compressed. Vorbis/AT9/FADPCM encoding only supported in the .FSB container format. During playback the FMOD software mixer will decode it in realtime as a 'compressed sample'. Overrides FMOD_CREATESAMPLE. If the sound data is not one of the supported formats, it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM.

FMOD_OPENUSER

Opens a user created static sample or stream. Use FMOD_CREATESOUNDEXINFO to specify format and/or read callbacks. If a user created 'sample' is created with no read callback, the sample will be empty. Use Sound::lock and Sound::unlock to place sound data into the sound if this is the case.

FMOD_OPENMEMORY

"name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. If used with FMOD_CREATESAMPLE or FMOD_CREATECOMPRESSEDSAMPLE, FMOD duplicates the memory into its own buffers. Your own buffer can be freed after open. If used with FMOD_CREATESTREAM, FMOD will stream out of the buffer whose pointer you passed in. In this case, your own buffer should not be freed until you have finished with and released the stream.

FMOD_OPENMEMORY_POINT

"name_or_data" will be interpreted as a pointer to memory instead of filename for creating sounds. Use FMOD_CREATESOUNDEXINFO to specify length. This differs to FMOD_OPENMEMORY in that it uses the memory as is, without duplicating the memory into its own buffers. Cannot be freed after open, only after Sound::release. Will not work if the data is compressed and FMOD_CREATECOMPRESSEDSAMPLE is not used.

FMOD_OPENRAW

Will ignore file format and treat as raw pcm. Use FMOD_CREATESOUNDEXINFO to specify format. Requires at least defaultfrequency, numchannels and format to be specified before it will open. Must be little endian data.

FMOD_OPENONLY

Just open the file, dont prebuffer or read. Good for fast opens for info, or when sound::readData is to be used.

FMOD_ACCURATETIME

For System::createSound - for accurate Sound::getLength/Channel::setPosition on VBR MP3, and MOD/S3M/XM/IT/MIDI files. Scans file first, so takes longer to open. FMOD_OPENONLY does not affect this.

FMOD_MPEGSEARCH

For corrupted / bad MP3 files. This will search all the way through the file until it hits a valid MPEG header. Normally only searches for 4k.

FMOD_NONBLOCKING

For opening sounds and getting streamed subsounds (seeking) asyncronously. Use Sound::getOpenState to poll the state of the sound as it opens or retrieves the subsound in the background.

FMOD_UNIQUE

Unique sound, can only be played one at a time

FMOD_3D_HEADRELATIVE

Make the sound's position, velocity and orientation relative to the listener.

FMOD_3D_WORLDRELATIVE

Make the sound's position, velocity and orientation absolute (relative to the world). (DEFAULT)

FMOD_3D_INVERSEROLLOFF

This sound will follow the inverse rolloff model where mindistance = full volume, maxdistance = where sound stops attenuating, and rolloff is fixed according to the global rolloff factor. (DEFAULT)

FMOD_3D_LINEARROLLOFF

This sound will follow a linear rolloff model where mindistance = full volume, maxdistance = silence.

FMOD_3D_LINEARSQUAREROLLOFF

This sound will follow a linear-square rolloff model where mindistance = full volume, maxdistance = silence.

FMOD_3D_INVERSETAPEREDROLLOFF

This sound will follow the inverse rolloff model at distances close to mindistance and a linear-square rolloff close to maxdistance.

FMOD_3D_CUSTOMROLLOFF

This sound will follow a rolloff model defined by Sound::set3DCustomRolloff / Channel::set3DCustomRolloff.

FMOD_3D_IGNOREGEOMETRY

Is not affect by geometry occlusion. If not specified in Sound::setMode, or Channel::setMode, the flag is cleared and it is affected by geometry again.

FMOD_IGNORETAGS

Skips id3v2/asf/etc tag checks when opening a sound, to reduce seek/read overhead when opening files (helps with CD performance).

FMOD_LOWMEM

Removes some features from samples to give a lower memory overhead, like Sound::getName. See remarks.

FMOD_LOADSECONDARYRAM

Load sound into the secondary RAM of supported platform. On PS3, sounds will be loaded into RSX/VRAM.

FMOD_VIRTUAL_PLAYFROMSTART

For sounds that start virtual (due to being quiet or low importance), instead of swapping back to audible, and playing at the correct offset according to time, this flag makes the sound play from the start.

See Also




Version 1.10.03 Built on Feb 1, 2018