AudioStreamPlaybackPolyphonic
Playback instance for AudioStreamPolyphonic
.
class AudioStreamPlaybackPolyphonic
Playback instance for AudioStreamPolyphonic
. After setting the stream
property of AudioStreamPlayer
, AudioStreamPlayer2D
, or AudioStreamPlayer3D
, the playback instance can be obtained by calling getStreamPlayback
, getStreamPlayback
or getStreamPlayback
methods.
Superclasses
class AudioStreamPlayback
Meta class for playing back audio.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
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 Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
static let invalidId: Int
Returned by
playStream(_:fromOffset:volumeDb:pitchScale:playbackType:bus:)
in case it could not allocate a stream for playback.class var godotClassName: StringName
Instance members
func isStreamPlaying(stream: Int
) -> Bool Return true whether the stream associated with an integer ID is still playing. Check
playStream(_:fromOffset:volumeDb:pitchScale:playbackType:bus:)
for information on when this ID becomes invalid.func playStream(AudioStream?, fromOffset: Double, volumeDb: Double, pitchScale: Double, playbackType: AudioServer.PlaybackType, bus: StringName
) -> Int Play an
AudioStream
at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately.func setStreamPitchScale(stream: Int, pitchScale: Double
) Change the stream pitch scale. The
stream
argument is an integer ID returned byplayStream(_:fromOffset:volumeDb:pitchScale:playbackType:bus:)
.func setStreamVolume(stream: Int, volumeDb: Double
) Change the stream volume (in db). The
stream
argument is an integer ID returned byplayStream(_:fromOffset:volumeDb:pitchScale:playbackType:bus:)
.func stopStream(Int
) Stop a stream. The
stream
argument is an integer ID returned byplayStream(_:fromOffset:volumeDb:pitchScale:playbackType:bus:)
, which becomes invalid after calling this function.