-
Notifications
You must be signed in to change notification settings - Fork 0
AudioServer
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.AudioServer |
| Namespace | Electron2D |
| Kind | class |
| Category | Audio |
Provides process-wide audio device, bus and voice playback state.
public static class Electron2D.AudioServerAudioServer is the public boundary for querying audio output state.
It keeps concrete platform backend handles internal to the runtime.
Electron2D 0.1.0 Preview exposes a single default Master bus and
internal voice lifecycle used by future playback nodes. User buses, volume
routing and audio effects are added by later audio tasks.
All public methods synchronize access to process-wide audio state. Calls to
Electron2D.AudioServer.Lock and Electron2D.AudioServer.Unlock must be balanced on the same
thread.
This class is available since Electron2D 0.1.0 Preview.
Electron2D.AudioStream
| Member | Kind | Summary |
|---|---|---|
GetBusCount() |
Method | Gets the number of audio buses available to the server. |
GetBusIndex(System.String) |
Method | Gets the index of an audio bus by name. |
GetBusName(System.Int32) |
Method | Gets the name of an audio bus by index. |
GetMixRate() |
Method | Gets the audio mix rate in hertz. |
GetOutputLatency() |
Method | Gets the current audio output latency estimate. |
GetSpeakerMode() |
Method | Gets the speaker layout reported by the active audio output. |
Lock() |
Method | Locks the audio server for a group of audio changes. |
Unlock() |
Method | Unlocks the audio server after a grouped audio change. |
Kind: Method
public static System.Int32 GetBusCount()()Gets the number of audio buses available to the server.
Electron2D 0.1.0 Preview exposes only the default bus. User-defined buses and routing controls are added by the audio bus task.
The number of buses, including the default Master bus.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.GetBusIndex(System.String)Electron2D.AudioServer.GetBusName(System.Int32)
Kind: Method
public static System.Int32 GetBusIndex(System.String)(System.String busName)Gets the index of an audio bus by name.
Bus lookup is case-sensitive. The preview server recognizes
Master and returns -1 for every other valid name.
-
busName: The bus name to search for.
The zero-based bus index, or -1 when no bus has the requested name.
-
System.ArgumentException: Thrown whenbusNameis empty or whitespace. -
System.ArgumentNullException: Thrown whenbusNameisnull.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.GetBusName(System.Int32)
Kind: Method
public static System.String GetBusName(System.Int32)(System.Int32 busIdx)Gets the name of an audio bus by index.
The preview server contains only index 0, named Master.
-
busIdx: The zero-based bus index to query.
The bus name.
-
System.ArgumentOutOfRangeException: Thrown whenbusIdxdoes not identify an existing bus.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.GetBusCountElectron2D.AudioServer.GetBusIndex(System.String)
Kind: Method
public static System.Single GetMixRate()()Gets the audio mix rate in hertz.
The preview backend defaults to 48000. Platform backends may
report a different value when the active audio device requires it.
The number of output sample frames mixed per second.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.GetOutputLatencyElectron2D.AudioServer.GetSpeakerMode
Kind: Method
public static System.Single GetOutputLatency()()Gets the current audio output latency estimate.
The value is an estimate supplied by the active backend. The default
preview backend reports 0 because it does not own a physical
output device.
The estimated output latency in seconds.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.GetMixRate
Kind: Method
public static Electron2D.AudioServer.SpeakerMode GetSpeakerMode()()Gets the speaker layout reported by the active audio output.
The value is a query result only. Changing speaker layout is handled by platform startup settings and is not exposed in this preview server API.
The current speaker layout.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.SpeakerMode
Kind: Method
public static System.Void Lock()()Locks the audio server for a group of audio changes.
Use this method when several audio operations need to be observed as a
single change by the backend. Every successful call must be paired with
Electron2D.AudioServer.Unlock on the same thread.
This method is safe to call from any thread, but the matching
Electron2D.AudioServer.Unlock must be called from the same thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.Unlock
Kind: Method
public static System.Void Unlock()()Unlocks the audio server after a grouped audio change.
Call this method once for every successful Electron2D.AudioServer.Lock call.
Calling it without owning the audio server lock is an error.
This method must be called from the same thread that called
Electron2D.AudioServer.Lock.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.AudioServer.Lock
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.