![]() |
Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
Represents an audio resource that can be played, paused, resumed, sought, and disposed. Playback is supplied by the currently configured IAudioBackend. More...
Public Member Functions | |
| void | Play (bool fromStart=true) |
| Starts playback of the resource. | |
| void | Pause () |
| Pauses playback if currently playing. | |
| void | Resume () |
| Resumes playback if currently paused. | |
| void | Seek (TimeSpan position) |
| Seeks to the specified playback position. | |
| void | Stop () |
| Stops playback immediately. | |
| void | Dispose () |
| Disposes the audio resource and releases any underlying playback handle and temporary files. After disposal the instance must not be used. | |
Public Attributes | |
| Func< Task >? | PlaybackCompletedAsync |
| Optional asynchronous callback invoked when non-looping playback completes. | |
Static Public Attributes | |
| const float | MinimumPlaybackSpeed = 0.25f |
| Minimum allowed playback speed multiplier. Values below this are clamped. | |
| const float | MaximumPlaybackSpeed = 4.0f |
| Maximum allowed playback speed multiplier. Values above this are clamped. | |
Properties | |
| string | Key [get] |
| Gets the unique key associated with this audio resource. | |
| byte?[] | OriginalBytes [get] |
| Gets the original byte array of the audio data, if available. | |
| string? | SourceFilePath [get] |
| Original file path when the sound was loaded from disk. Null when loaded from an AssetsFile or URI. | |
| AssetsFileIdentifier? | AssetIdentifier [get] |
| Asset identifier when the sound was loaded from an AssetsFile. | |
| string? | SourceExtension [get] |
| Normalized file extension used by the configured backend. | |
| string? | SourceUri [get] |
| Source URI when the resource was loaded by URI, primarily for browser playback. | |
| string? | TempFilePath [get] |
| Gets the temporary file path used by a backend that requires file-based decoding, if any. | |
| bool | IsPaused [get] |
| Gets a value indicating whether playback is currently paused. | |
| bool | IsPlaying [get] |
| Gets a value indicating whether playback is currently active. | |
| AudioPlaybackState | State [get] |
| Gets the current high-level playback state of the resource. | |
| TimeSpan | CurrentTime [get, set] |
| Gets or sets the current playback position within the resource. Setting this property seeks to the specified position. | |
| TimeSpan | Duration [get] |
| Gets the total duration of the resource, or TimeSpan.Zero when unknown. | |
| bool | IsLooping [get, set] |
| Gets or sets whether playback loops continuously. | |
| float | Volume [get, set] |
| Gets or sets output volume in the range 0.0 through 1.0. | |
| float | Pan [get, set] |
| Gets or sets stereo pan from -1.0 (left) through 1.0 (right). | |
| float | PlaybackSpeed [get, set] |
| Gets or sets playback speed. 1.0 is normal speed; supported values are clamped to 0.25 through 4.0. | |
Events | |
| EventHandler? | PlaybackCompleted |
| Event raised when non-looping playback reaches the end of the resource. | |
| EventHandler? | Disposed |
| Event raised when the resource is disposed. | |
Represents an audio resource that can be played, paused, resumed, sought, and disposed. Playback is supplied by the currently configured IAudioBackend.
Definition at line 12 of file AudioResource.cs.
| void Gondwana.Audio.AudioResource.Dispose | ( | ) |
Disposes the audio resource and releases any underlying playback handle and temporary files. After disposal the instance must not be used.
Definition at line 345 of file AudioResource.cs.
| void Gondwana.Audio.AudioResource.Pause | ( | ) |
Pauses playback if currently playing.
| void Gondwana.Audio.AudioResource.Play | ( | bool | fromStart = true | ) |
Starts playback of the resource.
| fromStart | If true, playback begins from the start of the resource; otherwise resumes from the current position. |
| void Gondwana.Audio.AudioResource.Resume | ( | ) |
Resumes playback if currently paused.
| void Gondwana.Audio.AudioResource.Seek | ( | TimeSpan | position | ) |
Seeks to the specified playback position.
| position | Target playback position. Values outside the valid range are clamped by the backend. |
| void Gondwana.Audio.AudioResource.Stop | ( | ) |
Stops playback immediately.
|
static |
Maximum allowed playback speed multiplier. Values above this are clamped.
Definition at line 23 of file AudioResource.cs.
|
static |
Minimum allowed playback speed multiplier. Values below this are clamped.
1.0 is normal speed; values <1 slow playback, >1 speed up playback.
Definition at line 18 of file AudioResource.cs.
| Func<Task>? Gondwana.Audio.AudioResource.PlaybackCompletedAsync |
Optional asynchronous callback invoked when non-looping playback completes.
Definition at line 48 of file AudioResource.cs.
|
get |
Asset identifier when the sound was loaded from an AssetsFile.
Definition at line 107 of file AudioResource.cs.
|
getset |
Gets or sets the current playback position within the resource. Setting this property seeks to the specified position.
Definition at line 146 of file AudioResource.cs.
|
get |
Gets the total duration of the resource, or TimeSpan.Zero when unknown.
Definition at line 156 of file AudioResource.cs.
|
getset |
Gets or sets whether playback loops continuously.
Definition at line 159 of file AudioResource.cs.
|
get |
Gets a value indicating whether playback is currently paused.
Definition at line 127 of file AudioResource.cs.
|
get |
Gets a value indicating whether playback is currently active.
Definition at line 133 of file AudioResource.cs.
|
get |
Gets the unique key associated with this audio resource.
Definition at line 93 of file AudioResource.cs.
|
get |
Gets the original byte array of the audio data, if available.
Definition at line 97 of file AudioResource.cs.
|
getset |
Gets or sets stereo pan from -1.0 (left) through 1.0 (right).
Definition at line 184 of file AudioResource.cs.
|
getset |
Gets or sets playback speed. 1.0 is normal speed; supported values are clamped to 0.25 through 4.0.
Definition at line 199 of file AudioResource.cs.
|
get |
Normalized file extension used by the configured backend.
Definition at line 111 of file AudioResource.cs.
|
get |
Original file path when the sound was loaded from disk. Null when loaded from an AssetsFile or URI.
Definition at line 103 of file AudioResource.cs.
|
get |
Source URI when the resource was loaded by URI, primarily for browser playback.
Definition at line 115 of file AudioResource.cs.
|
get |
Gets the current high-level playback state of the resource.
Definition at line 139 of file AudioResource.cs.
|
get |
Gets the temporary file path used by a backend that requires file-based decoding, if any.
Definition at line 121 of file AudioResource.cs.
|
getset |
Gets or sets output volume in the range 0.0 through 1.0.
Definition at line 171 of file AudioResource.cs.
| EventHandler? Gondwana.Audio.AudioResource.Disposed |
Event raised when the resource is disposed.
Definition at line 53 of file AudioResource.cs.
| EventHandler? Gondwana.Audio.AudioResource.PlaybackCompleted |
Event raised when non-looping playback reaches the end of the resource.
Definition at line 43 of file AudioResource.cs.