phaser - v4.0.0-rc.4
    Preparing search index...

    Type Alias SpatialSoundConfig

    Config object containing settings for the source of the spatial sound.

    See https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics

    type SpatialSoundConfig = {
        coneInnerAngle?: number;
        coneOuterAngle?: number;
        coneOuterGain?: number;
        distanceModel?: "linear" | "inverse" | "exponential";
        follow?: Vector2Like;
        maxDistance?: number;
        orientationX?: number;
        orientationY?: number;
        orientationZ?: number;
        panningModel?: "equalpower" | "HRTF";
        refDistance?: number;
        rolloffFactor?: number;
        x?: number;
        y?: number;
        z?: number;
    }
    Index

    Properties

    coneInnerAngle?: number

    The angle, in degrees, of a cone inside of which there will be no volume reduction.

    coneOuterAngle?: number

    The angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the coneOuterGain property.

    coneOuterGain?: number

    The amount of volume reduction outside the cone defined by the coneOuterAngle attribute. Its default value is 0, meaning that no sound can be heard. A value between 0 and 1.

    distanceModel?: "linear" | "inverse" | "exponential"

    Which algorithm to use to reduce the volume of the audio source as it moves away from the listener. Possible values are "linear", "inverse" and "exponential". The default value is "inverse".

    follow?: Vector2Like

    Set this Sound object to automatically track the x/y position of this object. Can be a Phaser Game Object, Vec2 or anything that exposes public x/y properties.

    maxDistance?: number

    The maximum distance between the audio source and the listener, after which the volume is not reduced any further.

    orientationX?: number

    The horizontal position of the audio source's vector in a right-hand Cartesian coordinate system.

    orientationY?: number

    The vertical position of the audio source's vector in a right-hand Cartesian coordinate system.

    orientationZ?: number

    Represents the longitudinal (back and forth) position of the audio source's vector in a right-hand Cartesian coordinate system.

    panningModel?: "equalpower" | "HRTF"

    An enumerated value determining which spatialization algorithm to use to position the audio in 3D space.

    refDistance?: number

    A double value representing the reference distance for reducing volume as the audio source moves further from the listener. For distances greater than this the volume will be reduced based on rolloffFactor and distanceModel.

    rolloffFactor?: number

    A double value describing how quickly the volume is reduced as the source moves away from the listener. This value is used by all distance models.

    x?: number

    The horizontal position of the audio in a right-hand Cartesian coordinate system.

    y?: number

    The vertical position of the audio in a right-hand Cartesian coordinate system.

    z?: number

    Represents the longitudinal (back and forth) position of the audio in a right-hand Cartesian coordinate system.