Class AudioStreamPlaybackPolyphonic
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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.
public class AudioStreamPlaybackPolyphonic : AudioStreamPlayback, IDisposable
- Inheritance
-
AudioStreamPlaybackPolyphonic
- Implements
- Inherited Members
Fields
InvalidId
Returned by PlayStream(AudioStream, float, float, float) in case it could not allocate a stream for playback.
public const long InvalidId = -1
Field Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
IsStreamPlaying(long)
Return true whether the stream associated with an integer ID is still playing. Check PlayStream(AudioStream, float, float, float) for information on when this ID becomes invalid.
public bool IsStreamPlaying(long stream)
Parameters
stream
long
Returns
PlayStream(AudioStream, float, float, float)
Play an AudioStream at a given offset, volume and pitch scale. Playback starts immediately.
The return value is a unique integer ID that is associated to this playback stream and which can be used to control it.
This ID becomes invalid when the stream ends (if it does not loop), when the AudioStreamPlaybackPolyphonic is stopped, or when StopStream(long) is called.
This function returns InvalidId if the amount of streams currently playing equals Polyphony. If you need a higher amount of maximum polyphony, raise this value.
public long PlayStream(AudioStream stream, float fromOffset = 0, float volumeDb = 0, float pitchScale = 1)
Parameters
stream
AudioStreamfromOffset
floatvolumeDb
floatpitchScale
float
Returns
SetStreamPitchScale(long, float)
Change the stream pitch scale. The stream
argument is an integer ID returned by PlayStream(AudioStream, float, float, float).
public void SetStreamPitchScale(long stream, float pitchScale)
Parameters
SetStreamVolume(long, float)
Change the stream volume (in db). The stream
argument is an integer ID returned by PlayStream(AudioStream, float, float, float).
public void SetStreamVolume(long stream, float volumeDb)
Parameters
StopStream(long)
Stop a stream. The stream
argument is an integer ID returned by PlayStream(AudioStream, float, float, float), which becomes invalid after calling this function.
public void StopStream(long stream)
Parameters
stream
long