Unreal Integration 2.02

6. API Reference | Common

Types:

Methods:

FFMODAttenuationDetails

Override the attenuation values from FMOD Studio.

C++

struct FFMODAttenuationDetails
{
    uint32 bOverrideAttenuation;
    float MinimumDistance;
    float MaximumDistance;
};
bOverrideAttenuation
Should we use attenuation set in Studio or be able to modify in Editor.
MinimumDistance
Override the event's 3D minimum distance.
MaximumDistance
Override the event's 3D maximum distance.

EFMODEventProperty

These definitions describe built-in event properties.

C++

enum Type
{
    ChannelPriority,
    ScheduleDelay,
    ScheduleLookahead,
    MinimumDistance,
    MaximumDistance,
    Count
};
ChannelPriority

Priority to set on low-level channels created by this event instance.

  • Range: [-1, 256]
  • Default: -1
ScheduleDelay

Schedule delay to synchronized playback for multiple tracks in DSP clocks, or -1 for default.

  • Range: -1, [0, inf]
  • Default: -1
ScheduleLookahead

Schedule look-ahead on the timeline in DSP clocks, or -1 for default.

  • Range: -1, [0, inf]
  • Default: -1
MinimumDistance

Override the event's 3D minimum distance, or -1 for default.

  • Range: -1, [0, inf]
  • Default: -1
MaximumDistance

Override the event's 3D maximum distance, or -1 for default.

  • Range: -1, [0, inf]
  • Default: -1
Count
Number of options.

EFMODSystemContext

Which FMOD Studio system to use.

C++

enum Type
{
    Auditioning,
    Runtime,
    Editor,
    Max
};
Auditioning
For use auditioning sounds within the editor.
Runtime
For use in PIE and in-game.
Editor
For use when playing events in an editor world (e.g. previewing a level sequence).
Max
Upper bound of types.

FFMODOcclusionDetails

Occlusion details.

C++

struct FFMODOcclusionDetails
{
    bool bEnableOcclusion;
    TEnumAsByte<enum ECollisionChannel> OcclusionTraceChannel;
    bool bUseComplexCollisionForOcclusion;
}
bEnableOcclusion
Enable occlusion settings.
OcclusionTraceChannel
Which trace channel to use for audio occlusion checks.
bUseComplexCollisionForOcclusion
Whether or not to enable complex geometry occlusion checks.

FMOD_VECTOR_SCALE_DEFAULT

This constant is used to convert unreal units to meters for FMOD Studio. The default value is appropriate for games that follow the Unreal Engine's convention of 1 unreal unit == 1cm; if your game world's scale uses a different length for unreal units, you can alter this value in FMODUtils.h.

C++

#define FMOD_VECTOR_SCALE_DEFAULT 0.01f

FMODUtils::LogError

Helper function to debug FMOD function calls.

C++

void LogError(
    FMOD_RESULT result,
    const char *function
);
result
Result of an FMOD function call.
function
The function that is being checked.

FMODUtils::Assign

Helper function to convert from UE world axis to FMOD axis.

C++

void Assign(
    FMOD_VECTOR &Dest
    const FVector &Src
);
void Assign(
    FMOD_3D_ATTRIBUTES &Dest,
    const FTransform &Src
);
Dest
Returned FMOD vector.
Src
Unreal vector to be converted.

FMODUtils::ConvertWorldVector

Helper function to convert from UE world vector to FMOD vector.

C++

FMOD_VECTOR ConvertWorldVector(
    const FVector &Src
);
Src
Source vector to be converted.

FMODUtils::ConvertUnitVector

Helper function for converting unit vector to be used by FMOD.

C++

FMOD_VECTOR ConvertUnitVector(
    const FVector &Src
);
Src
Unit vector to be converted.

FMODUtils::DistanceToUEScale

Helper function to convert from FMOD distance to UE scale.

C++

float DistanceToUEScale(
    float FMODDistance
);
FMODDistance
Distance in FMOD scale.

FMODUtils::IsWorldAudible

Helper function to know if an object is audible in the world.

C++

bool IsWorldAudible(
    UWorld *World,
    bool AllowInEditor
);
World
A pointer to the current world.
AllowInEditor
Whether editor world objects should be considered audible when determining audibility.

FMODUtils::ConvertGuid

Helper function to convert from UE GUID to FMOD Studio ID.

C++

FMOD::Studio::ID ConvertGuid(
    const FGuid &UnrealGuid
);
UnrealGuid
The GUID to be converted.

FMODUtils::GetID

Helper function to get UE GUID from an FMOD instanced object.

C++

FGuid GetID(
    StudioType *Instance
);
Instance
An instance of an FMOD object.

FMODUtils::GetPath

Helper function to get the path of an event.

C++

FString GetPath(
    StudioType *Instance
);
Instance
An instance of an FMOD object.

FMODUtils::LookupNameFromGuid

Helper function to return the name of an event using its Guid.

C++

FString LookupNameFromGuid(
    FMOD::Studio::System *StudioSystem,
    const FGuid &Guid
);
FString LookupNameFromGuid(
    FMOD::Studio::System *StudioSystem,
    const FMOD::Studio::ID &Guid
);
studioSystem
Current FMOD Studio System.
Guid
GUID to retrieve the name of.

FMODUtils::ParameterTypeToString

Helper function to return the FMOD Studio Parameter as a string.

C++

FString ParameterTypeToString(
    FMOD_STUDIO_PARAMETER_TYPE Type
);
Type
Helper function to return a parameter type as a string.