Handle for operating AudioLink from a script.
You can obtain this handle via audioLink.

If the target is a craft item or an item that does not have an AudioLink component, calls to AudioLinkHandle methods are ignored.

Example

// Example: receive a sent message and change the AudioLink gain
const al = $.audioLink();

$.onReceive((messageType, args, sender) => {
if (messageType === "SetParam") {
if (args.prop === "Gain") {
al.setGain(args.value);
al.applySettings();
}
}
});

Hierarchy

  • AudioLinkHandle

Methods

  • Applies the property values that have been set to AudioLink.

    Returns void

  • Sets the influence of autogain.
    Larger values increase the influence.

    The specified value is clamped between 0.001 and 1.0.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • derate: number

    Returns void

  • Sets the bass amplification factor.

    The specified value is clamped between 0 and 2.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • bass: number

    Returns void

  • Sets the crossover point for the bass band.
    The frequency of the crossover is adjusted according to the given value.

    The specified value is clamped between 0 and 0.168.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • crossoverPoint: number

    Returns void

  • Sets the crossover point between the bass and low-mid bands.
    The frequency of the crossover is adjusted according to the given value.

    The specified value is clamped between 0.242 and 0.387.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • crossoverPoint: number

    Returns void

  • Sets the crossover point between the low-mid and mid-high bands.
    The frequency of the crossover is adjusted according to the given value.

    The specified value is clamped between 0.461 and 0.628.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • crossoverPoint: number

    Returns void

  • Sets the crossover point between the mid-high and treble bands.
    The frequency of the crossover is adjusted according to the given value.

    The specified value is clamped between 0.704 and 0.953.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • crossoverPoint: number

    Returns void

  • Enables or disables autogain.

    Parameters

    • enableAutogain: boolean

    Returns void

  • Sets the fade exponential fall-off.
    Higher values result in a steeper exponential decay.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • fadeExpFalloff: number

    Returns void

  • Sets the fade length.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • fadeLength: number

    Returns void

  • Sets the gain.

    The specified value is clamped between 0 and 2.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • gain: number

    Returns void

  • Sets the threshold level for the bass band.
    Lower values make the band more sensitive.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • threshold: number

    Returns void

  • Sets the threshold level for the low-mid band.
    Lower values make the band more sensitive.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • threshold: number

    Returns void

  • Sets the threshold level for the mid-high band.
    Lower values make the band more sensitive.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • threshold: number

    Returns void

  • Sets the threshold level for the treble band.
    Lower values make the band more sensitive.

    The specified value is clamped between 0 and 1.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • threshold: number

    Returns void

  • Sets the treble amplification factor.

    The specified value is clamped between 0 and 2.
    If the value is NaN, Infinity, or -Infinity, the call is ignored.

    Parameters

    • treble: number

    Returns void

Generated using TypeDoc