RSX Code Reference
    Preparing search index...
    • rsx
    • ActiveAudioSource

    Class ActiveAudioSourceAbstract

    Represents a source for emitting audio. Audio can be played spatially (gun shot), or normally (music). Each audio source must have an AudioClip to play-back, and it can also have a position in the case of spatial (3D) audio.

    Whether or not an audio source is spatial is controlled by the assigned AudioClip. The volume and the pitch of a spatial audio source is controlled by its position and the AudioListener position/direction/velocity.

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns ActiveAudioSource

    • get attenuation(): number

      Attenuation that controls how quickly does audio volume drop off as the listener moves further from the source.

      Returns number

    • set attenuation(value: number): void

      Parameters

      • value: number

      Returns void

    • get isLooping(): boolean

      Determines whether the audio clip should loop when it finishes playing.

      Returns boolean

    • set isLooping(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get minDistance(): number

      Minimum distance at which audio attenuation starts. When the listener is closer to the source than this value, audio is heard at full volume. Once farther away the audio starts attenuating.

      Returns number

    • set minDistance(value: number): void

      Parameters

      • value: number

      Returns void

    • get pitch(): number

      Determines the pitch of the played audio. 1 is the default.

      Returns number

    • set pitch(value: number): void

      Parameters

      • value: number

      Returns void

    • set priority(value: number): void

      Determines the priority of the audio source. If more audio sources are playing than supported by the hardware, some might get disabled. By setting a higher priority the audio source is guaranteed to be disabled after sources with lower priority.

      Parameters

      • value: number

      Returns void

    • get time(): number

      Determines the current time of playback. If playback hasn't yet started, it specifies the time at which playback will start at. The time is in seconds, in range [0, clipLength].

      Returns number

    • set time(value: number): void

      Parameters

      • value: number

      Returns void

    • get volume(): number

      Volume of the audio played from this source, in [0, 1] range.

      Returns number

    • set volume(value: number): void

      Parameters

      • value: number

      Returns void

    • Pauses the audio playback.

      Returns void

    • Stops audio playback, rewinding it to the start.

      Returns void