AttenuationModel
AudioStreamPlayer3D.swift:31enum AttenuationModelenum AttenuationModelimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class AudioStreamPlayer3DPlays positional sound in 3D space.
case inverseDistanceAttenuation of loudness according to linear distance.
case inverseSquareDistanceAttenuation of loudness according to squared distance.
case logarithmicAttenuation of loudness according to logarithmic distance.
case disabledNo attenuation of loudness according to distance. The sound will still be heard positionally, unlike an AudioStreamPlayer. .attenuationDisabled can be combined with a maxDistance value greater than 0.0 to achieve linear attenuation clamped to a sphere of a defined size.
final var maxDistance: Double { get set }The distance past which the sound can no longer be heard at all. Only has an effect if set to a value greater than 0.0. maxDistance works in tandem with unitSize. However, unlike unitSize whose behavior depends on the attenuationModel, maxDistance always works in a linear fashion. This can be used to prevent the AudioStreamPlayer3D from requiring audio mixing when the listener is far away, which saves CPU resources.
override class var godotClassName: StringName { get }final var areaMask: UInt32 { get set }Determines which Area3D layers affect the sound for reverb and audio bus effects. Areas can be used to redirect AudioStreams so that they play in a certain audio bus. An example of how you might use this is making a “water” area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
final var attenuationFilterCutoffHz: Double { get set }The cutoff frequency of the attenuation low-pass filter, in Hz. A sound above this frequency is attenuated more than a sound below this frequency. To disable this effect, set this to 20500 as this frequency is above the human hearing limit.
final var attenuationFilterDb: Double { get set }Amount how much the filter affects the loudness, in decibels.
final var attenuationModel: AudioStreamPlayer3D.AttenuationModel { get set }Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
final var autoplay: Bool { get set }If true, audio plays when the AudioStreamPlayer3D node is added to scene tree.
final var bus: StringName { get set }The bus on which this audio is playing.
final var dopplerTracking: AudioStreamPlayer3D.DopplerTracking { get set }Decides in which step the Doppler effect should be calculated.
final var emissionAngleDegrees: Double { get set }The angle in which the audio reaches a listener unattenuated.
final var emissionAngleEnabled: Bool { get set }If true, the audio should be attenuated according to the direction of the sound.
final var emissionAngleFilterAttenuationDb: Double { get set }Attenuation factor used if listener is outside of emissionAngleDegrees and emissionAngleEnabled is set, in decibels.
var finished: SimpleSignal { get }Emitted when the audio stops playing.
final var maxDb: Double { get set }Sets the absolute maximum of the sound level, in decibels.
final var maxPolyphony: Int32 { get set }The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
final var panningStrength: Double { get set }Scales the panning strength for this node by multiplying the base ProjectSettings/audio/general/3dPanningStrength with this factor. Higher values will pan audio from left to right more dramatically than lower values.
final var pitchScale: Double { get set }The pitch and the tempo of the audio, as a multiplier of the audio sample’s sample rate.
final var playbackType: AudioServer.PlaybackType { get set }The playback type of the stream player. If set other than to the default value, it will force that playback type.
final var stream: AudioStream? { get set }The AudioStream resource to be played.
final var streamPaused: Bool { get set }If true, the playback is paused. You can resume it by setting streamPaused to false.
final var unitSize: Double { get set }The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
final var volumeDb: Double { get set }The base sound level before attenuation, in decibels.
final func getPlaybackPosition() -> Double Returns the position in the AudioStream.
final func getStreamPlayback() -> AudioStreamPlayback? Returns the AudioStreamPlayback object associated with this AudioStreamPlayer3D.
final func hasStreamPlayback() -> Bool Returns whether the AudioStreamPlayer can return the AudioStreamPlayback object or not.
final func isPlaying() -> Bool final func play(fromPosition: Double = 0.0) Queues the audio to play on the next physics frame, from the given position fromPosition, in seconds.
final func seek(toPosition: Double) Sets the position from which audio will be played, in seconds.
final func stop() Stops the audio.
enum DopplerTrackingprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)