Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
DopplerTracking
AudioStreamPlayer3D.swift:53enum DopplerTracking
Cases
case disabled
Disables doppler tracking.
case idleStep
Executes doppler tracking during process frames (see
Node
notificationInternalProcess````).case physicsStep
Executes doppler tracking during physics frames (see
Node
notificationInternalPhysicsProcess````).
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (30) members.
Types
Type members
Instance members
var areaMask: UInt32
Determines which
Area3D
layers affect the sound for reverb and audio bus effects. Areas can be used to redirectAudioStream
s 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.var attenuationFilterCutoffHz: Double
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.var attenuationFilterDb: Double
Amount how much the filter affects the loudness, in decibels.
var attenuationModel: AudioStreamPlayer3D.AttenuationModel
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
var autoplay: Bool
If
true
, audio plays when the AudioStreamPlayer3D node is added to scene tree.var bus: StringName
The bus on which this audio is playing.
var dopplerTracking: AudioStreamPlayer3D.DopplerTracking
Decides in which step the Doppler effect should be calculated.
var emissionAngleDegrees: Double
The angle in which the audio reaches a listener unattenuated.
var emissionAngleEnabled: Bool
If
true
, the audio should be attenuated according to the direction of the sound.var emissionAngleFilterAttenuationDb: Double
Attenuation factor used if listener is outside of
emissionAngleDegrees
andemissionAngleEnabled
is set, in decibels.var finished: SimpleSignal
Emitted when the audio stops playing.
var maxDb: Double
Sets the absolute maximum of the sound level, in decibels.
var maxDistance: Double
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 withunitSize
. However, unlikeunitSize
whose behavior depends on theattenuationModel
,maxDistance
always works in a linear fashion. This can be used to prevent theAudioStreamPlayer3D
from requiring audio mixing when the listener is far away, which saves CPU resources.var maxPolyphony: Int32
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.
var panningStrength: Double
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.var pitchScale: Double
The pitch and the tempo of the audio, as a multiplier of the audio sample’s sample rate.
var playbackType: AudioServer.PlaybackType
The playback type of the stream player. If set other than to the default value, it will force that playback type.
var stream: AudioStream?
The
AudioStream
resource to be played.var streamPaused: Bool
If
true
, the playback is paused. You can resume it by settingstreamPaused
tofalse
.var unitSize: Double
The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
var volumeDb: Double
The base sound level before attenuation, in decibels.
func getPlaybackPosition(
) -> Double Returns the position in the
AudioStream
.func getStreamPlayback(
) -> AudioStreamPlayback? Returns the
AudioStreamPlayback
object associated with thisAudioStreamPlayer3D
.func hasStreamPlayback(
) -> Bool Returns whether the
AudioStreamPlayer
can return theAudioStreamPlayback
object or not.func isPlaying(
) -> Bool func play(fromPosition: Double
) Queues the audio to play on the next physics frame, from the given position
fromPosition
, in seconds.func seek(toPosition: Double
) Sets the position from which audio will be played, in seconds.
func stop(
) Stops the audio.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A 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.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.