Skip to content

AudioStream

Eduard Gushchin edited this page Jul 1, 2026 · 4 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.AudioStream
Namespace Electron2D
Kind class
Category Audio

Overview

Provides the base resource for audio data that can be played by audio nodes.

Syntax

public abstract class Electron2D.AudioStream : Electron2D.Resource

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: AudioStream

Base audio stream resource with length, monophonic, meta-stream and sample eligibility metadata queries.

Remarks

AudioStream describes reusable sound or music data. Concrete stream instances are created by the resource import pipeline and are consumed by audio playback nodes such as Electron2D.AudioStreamPlayer and Electron2D.AudioStreamPlayer2D.

Electron2D 0.1.0 Preview exposes stream metadata queries only. Device lifecycle, user bus routing and public stream playback handle objects are separate audio runtime tasks.

Thread Safety

This type is not synchronized. Create and mutate stream resources on the main thread that owns the scene tree. Immutable metadata queries may be called from any thread by concrete implementations that document that behavior.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStreamPlayer
  • Electron2D.AudioStreamPlayer2D
  • Electron2D.Resource

Members

Member Kind Summary
Electron2D.AudioStream() Constructor Initializes a new instance of the Electron2D.AudioStream type.
CanBeSampled() Method Checks whether the stream can be converted into a static audio sample.
GetLength() Method Returns the stream length in seconds.
IsMetaStream() Method Checks whether this stream is a collection of other streams.
IsMonophonic() Method Checks whether this stream contains exactly one audio channel.

Member Details

Electron2D.AudioStream()

Kind: Constructor

public Electron2D.AudioStream()

Summary

Initializes a new instance of the Electron2D.AudioStream type.

Remarks

The new stream has no playback state. Concrete implementations provide metadata through overridden query methods.

Thread Safety

This constructor is not synchronized. Call it from the thread that owns the resource being created.

Since

This constructor is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStream

CanBeSampled()

Kind: Method

public System.Boolean CanBeSampled()()

Summary

Checks whether the stream can be converted into a static audio sample.

Remarks

The base implementation returns false. Imported static streams override this method and return true; imported streaming streams keep returning false.

This preview method is a metadata query only. It does not decode audio data and does not allocate sample buffers.

Returns

true when the stream represents finite static data that can be sampled in memory; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete stream is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStream.GetLength

GetLength()

Kind: Method

public System.Single GetLength()()

Summary

Returns the stream length in seconds.

Remarks

Imported WAV and OGG streams return the duration discovered during import. Generated, microphone or indefinite future stream types should return 0.

Returns

The stream length in seconds, or 0 when the stream length is not finite or not known.

Thread Safety

This method is safe to call from any thread when the concrete stream is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStream.CanBeSampled

IsMetaStream()

Kind: Method

public System.Boolean IsMetaStream()()

Summary

Checks whether this stream is a collection of other streams.

Remarks

The base implementation returns false. Composite stream resources may override this method in later audio runtime tasks.

Returns

true when the stream selects or combines child streams; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete stream is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStream

IsMonophonic()

Kind: Method

public System.Boolean IsMonophonic()()

Summary

Checks whether this stream contains exactly one audio channel.

Remarks

The base implementation returns false. Imported streams override this method using the channel count discovered during import.

Returns

true when the stream is monophonic; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete stream is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AudioStream.GetLength

Clone this wiki locally