# 6. Studio API Reference | Common

Loading State:

- FMOD_STUDIO_LOADING_STATE Loading state of various objects.

Parameters:

- FMOD_STUDIO_PARAMETER_DESCRIPTION Describes an event parameter.
- FMOD_STUDIO_PARAMETER_ID Describes an event parameter identifier.
- FMOD_STUDIO_PARAMETER_FLAGS Flags describing the behavior of a parameter.

- FMOD_STUDIO_PARAMETER_TYPE Event parameter types.

Playback State:

- FMOD_STUDIO_PLAYBACK_STATE Playback state of various objects.

Profiling:

- FMOD_STUDIO_MEMORY_USAGE Memory usage statistics.

Utility Functions:

- Studio::parseID Parses a GUID from a string.

## FMOD_STUDIO_LOADING_STATE

Loading state of various objects.

C
C++
C#
JS

    typedef enum FMOD_STUDIO_LOADING_STATE {
      FMOD_STUDIO_LOADING_STATE_UNLOADING,
      FMOD_STUDIO_LOADING_STATE_UNLOADED,
      FMOD_STUDIO_LOADING_STATE_LOADING,
      FMOD_STUDIO_LOADING_STATE_LOADED,
      FMOD_STUDIO_LOADING_STATE_ERROR
    } FMOD_STUDIO_LOADING_STATE;

    enum Studio.LOADING_STATE
    {
        UNLOADING,
        UNLOADED,
        LOADING,
        LOADED,
        ERROR,
    }

    STUDIO_LOADING_STATE_UNLOADING
    STUDIO_LOADING_STATE_UNLOADED
    STUDIO_LOADING_STATE_LOADING
    STUDIO_LOADING_STATE_LOADED
    STUDIO_LOADING_STATE_ERROR

FMOD_STUDIO_LOADING_STATE_UNLOADING
  Currently unloading.
FMOD_STUDIO_LOADING_STATE_UNLOADED
  Not loaded.
FMOD_STUDIO_LOADING_STATE_LOADING
  Loading in progress.
FMOD_STUDIO_LOADING_STATE_LOADED
  Loaded and ready to play.
FMOD_STUDIO_LOADING_STATE_ERROR
  Failed to load.

See Also: Studio::Bank::getLoadingState, Studio::Bank::getSampleLoadingState, Studio::EventDescription::getSampleLoadingState

## FMOD_STUDIO_MEMORY_USAGE

Memory usage statistics.

C
C++
C#
JS

    typedef struct FMOD_STUDIO_MEMORY_USAGE {
      int exclusive;
      int inclusive;
      int sampledata;
    } FMOD_STUDIO_MEMORY_USAGE;

    struct Studio.MEMORY_USAGE
    {
      int exclusive;
      int inclusive;
      int sampledata;
    }

Not supported for JavaScript.

exclusive
  Size of memory belonging to the bus or event instance.
inclusive
  Size of memory belonging exclusively to the bus or event plus the inclusive memory sizes of all buses and event instances which route into it.
sampledata
  Size of shared sample memory referenced by the bus or event instance, inclusive of all sample memory referenced by all buses and event instances which route into it.

Memory usage `exclusive` and `inclusive` values do not include sample data loaded in memory because sample data is a shared resource. Streaming sample data is not a shared resource and is included in the `exclusive` and `inclusive` values.

See Also: FMOD_STUDIO_INIT_MEMORY_TRACKING, Studio::System::getMemoryUsage, Studio::Bus::getMemoryUsage, Studio::EventInstance::getMemoryUsage

## FMOD_STUDIO_PARAMETER_DESCRIPTION

Describes an event parameter.

C
C++
C#
JS

    typedef struct FMOD_STUDIO_PARAMETER_DESCRIPTION {
      const char                  *name;
      FMOD_STUDIO_PARAMETER_ID     id;
      float                        minimum;
      float                        maximum;
      float                        defaultvalue;
      FMOD_STUDIO_PARAMETER_TYPE   type;
      FMOD_STUDIO_PARAMETER_FLAGS  flags;
      FMOD_GUID                    guid;
    } FMOD_STUDIO_PARAMETER_DESCRIPTION;

    struct PARAMETER_DESCRIPTION
    {
        StringWrapper name;
        PARAMETER_ID id;
        float minimum;
        float maximum;
        float defaultvalue;
        PARAMETER_TYPE type;
        PARAMETER_FLAGS flags;
        Guid guid;
    }

    FMOD_STUDIO_PARAMETER_DESCRIPTION
    {
      name,
      id,
      minimum,
      maximum,
      defaultvalue,
      type,
      flags,
      guid
    };

name
  Parameter name. (UTF-8 string)
id
  Parameter id. (FMOD_STUDIO_PARAMETER_ID)
minimum
  Minimum parameter value.
maximum
  Maximum parameter value.
defaultvalue
  Default parameter value.
type
  Parameter type. (FMOD_STUDIO_PARAMETER_TYPE)
flags
  Parameter behavior flags. (FMOD_STUDIO_PARAMETER_FLAGS)
guid
  Parameter GUID. (FMOD_GUID)

See Also: Studio::System::getParameterDescriptionByName, Studio::System::getParameterDescriptionByID, Studio::EventDescription::getParameterDescriptionByName, Studio::EventDescription::getParameterDescriptionByID

## FMOD_STUDIO_PARAMETER_FLAGS

Flags describing the behavior of a parameter.

C
C++
C#
JS

    #define FMOD_STUDIO_PARAMETER_READONLY              0x00000001
    #define FMOD_STUDIO_PARAMETER_AUTOMATIC             0x00000002
    #define FMOD_STUDIO_PARAMETER_GLOBAL                0x00000004
    #define FMOD_STUDIO_PARAMETER_DISCRETE              0x00000008
    #define FMOD_STUDIO_PARAMETER_LABELED               0x00000010

    public enum PARAMETER_FLAGS : uint
    {
        READONLY  = 0x00000001,
        AUTOMATIC = 0x00000002,
        GLOBAL    = 0x00000004,
        DISCRETE  = 0x00000008,
        LABELED   = 0x00000010,
    }

    STUDIO_PARAMETER_READONLY   0x00000001
    STUDIO_PARAMETER_AUTOMATIC  0x00000002
    STUDIO_PARAMETER_GLOBALS    0x00000004
    STUDIO_PARAMETER_DISCRETE   0x00000008
    STUDIO_PARAMETER_LABELED    0x00000010

FMOD_STUDIO_PARAMETER_READONLY
  Read only.
FMOD_STUDIO_PARAMETER_AUTOMATIC
  Automatic parameter.
FMOD_STUDIO_PARAMETER_GLOBAL
  Global parameter.
FMOD_STUDIO_PARAMETER_DISCRETE
  Discrete parameter that operates on integers (whole numbers) rather than continuous fractional numbers.
FMOD_STUDIO_PARAMETER_LABELED
  Labeled discrete parameter that has a label for each integer value. This flag will never be set in banks built with FMOD Studio versions prior to 2.01.10. If this flag is set, FMOD_STUDIO_PARAMETER_DISCRETE will also be set.

See also: FMOD_STUDIO_PARAMETER_DESCRIPTION

## FMOD_STUDIO_PARAMETER_ID

Describes an event parameter identifier.

C
C++
C#
JS

    typedef struct FMOD_STUDIO_PARAMETER_ID
    {
        unsigned int data1;
        unsigned int data2;
    } FMOD_STUDIO_PARAMETER_ID;

    struct PARAMETER_ID
    {
        uint data1;
        uint data2;
    }

    FMOD_STUDIO_PARAMETER_ID
    {
        data1,
        data2
    };

data1
  First half of the ID.
data2
  Second half of the ID.

See also: FMOD_STUDIO_PARAMETER_DESCRIPTION

## FMOD_STUDIO_PARAMETER_TYPE

Event parameter types.

C
C++
C#
JS

    typedef enum FMOD_STUDIO_PARAMETER_TYPE {
      FMOD_STUDIO_PARAMETER_GAME_CONTROLLED,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED_ABSOLUTE,
      FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE_NORMALIZED,
      FMOD_STUDIO_PARAMETER_MAX
    } FMOD_STUDIO_PARAMETER_TYPE;

    enum PARAMETER_TYPE
    {
        GAME_CONTROLLED,
        AUTOMATIC_DISTANCE,
        AUTOMATIC_EVENT_CONE_ANGLE,
        AUTOMATIC_EVENT_ORIENTATION,
        AUTOMATIC_DIRECTION,
        AUTOMATIC_ELEVATION,
        AUTOMATIC_LISTENER_ORIENTATION,
        AUTOMATIC_SPEED,
        AUTOMATIC_SPEED_ABSOLUTE,
        AUTOMATIC_DISTANCE_NORMALIZED,
        MAX
    }

    STUDIO_PARAMETER_GAME_CONTROLLED
    STUDIO_PARAMETER_AUTOMATIC_DISTANCE
    STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE
    STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION
    STUDIO_PARAMETER_AUTOMATIC_DIRECTION
    STUDIO_PARAMETER_AUTOMATIC_ELEVATION
    STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION
    STUDIO_PARAMETER_AUTOMATIC_SPEED
    STUDIO_PARAMETER_AUTOMATIC_SPEED_ABSOLUTE
    STUDIO_PARAMETER_AUTOMATIC_DISTANCE_NORMALIZED
    STUDIO_PARAMETER_MAX

FMOD_STUDIO_PARAMETER_GAME_CONTROLLED
  API settable parameter.
FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE
  Distance between the event and the listener.
FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE
  Angle between the event's forward vector and the vector pointing from the event to the listener (0 to 180 degrees).
FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION
  Horizontal angle between the event's forward vector and listener's forward vector (-180 to 180 degrees).
FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION
  Horizontal angle between the listener's forward vector and the vector pointing from the listener to the event (-180 to 180 degrees).
FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION
  Angle between the listener's XZ plane and the vector pointing from the listener to the event (-90 to 90 degrees).
FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION
  Horizontal angle between the listener's forward vector and the global positive Z axis (-180 to 180 degrees).
FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED
  Magnitude of the relative velocity of the event and the listener.
FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED_ABSOLUTE
  Magnitude of the absolute velocity of the event.
FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE_NORMALIZED
  Distance between the event and the listener in the range min distance - max distance represented as 0 - 1.
FMOD_STUDIO_PARAMETER_MAX
  Maximum number of parameter types supported.

FMOD_STUDIO_PARAMETER_GAME_CONTROLLED type parameters may have their values set using the API. All other parameter types have their values automatically set by FMOD Studio when the system is updated.

The horizontal angle between vectors is found by projecting both vector's onto a plane and taking the angle between the projected vectors. For FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION and FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION type parameters the vectors are projected onto the listener's XZ plane. For FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION type parameters the vectors are projected onto the global XZ plane.

See Also: FMOD_STUDIO_PARAMETER_DESCRIPTION

## Studio::parseID

Parses a GUID from a string.

C
C++
C#
JS

    FMOD_RESULT Studio::parseID(
      const char *idstring,
      FMOD_GUID *id
    );

    FMOD_RESULT FMOD_Studio_ParseID(
      const char *idstring,
      FMOD_GUID *id
    );

    static RESULT Studio.Util.parseID(
      string idstring,
      out Guid id
    );

Not supported for JavaScript.

idstring
  String representation of the GUID. (UTF-8 string)
id Out
  GUID. (FMOD_GUID)

This function expects the string representation to be formatted as 32 digits separated by hyphens and enclosed in braces: `{00000000-0000-0000-0000-000000000000}`.

## FMOD_STUDIO_PLAYBACK_STATE

Playback state of various objects.

C
C++
C#
JS

    typedef enum FMOD_STUDIO_PLAYBACK_STATE {
      FMOD_STUDIO_PLAYBACK_PLAYING,
      FMOD_STUDIO_PLAYBACK_SUSTAINING,
      FMOD_STUDIO_PLAYBACK_STOPPED,
      FMOD_STUDIO_PLAYBACK_STARTING,
      FMOD_STUDIO_PLAYBACK_STOPPING
    } FMOD_STUDIO_PLAYBACK_STATE;

    enum Studio.PLAYBACK_STATE
    {
        PLAYING,
        SUSTAINING,
        STOPPED,
        STARTING,
        STOPPING,
    }

    STUDIO_PLAYBACK_PLAYING
    STUDIO_PLAYBACK_SUSTAINING
    STUDIO_PLAYBACK_STOPPED
    STUDIO_PLAYBACK_STARTING
    STUDIO_PLAYBACK_STOPPING

FMOD_STUDIO_PLAYBACK_PLAYING
  Playing.
FMOD_STUDIO_PLAYBACK_SUSTAINING
  The timeline cursor is paused on a sustain point. (Studio::EventInstance only.)
FMOD_STUDIO_PLAYBACK_STOPPED
  Stopped.
FMOD_STUDIO_PLAYBACK_STARTING
  Preparing to start.
FMOD_STUDIO_PLAYBACK_STOPPING
  Preparing to stop.

See Also: Studio::CommandReplay::getPlaybackState, Studio::EventInstance::getPlaybackState