TSdlAudioDeviceID
SDL Audio Device instance IDs.
Zero is used to signify an invalid/null device.
Definition
Unit: Neslib.Sdl3.Audio
Properties
Name | Description |
---|---|
ChannelMap | The current channel map. |
DefaultPlaybackDevice | The default playback audio device ID. |
DefaultRecordingDevice | The default recording audio device ID. |
IsPlaybackDevice | Whether this audio device is a playback device (instead of recording). |
Name | The human-readable name of this audio device. |
PlaybackDevices | A list of currently-connected audio playback devices. |
RecordingDevices | A list of currently-connected audio recording devices. |
Operators
Name | Description |
---|---|
Equal(TSdlAudioDeviceID, TSdlAudioDeviceID) | Used to compare against another TSdlAudioDeviceID. |
Equal(TSdlAudioDeviceID, Cardinal) | Used to compare against 0 . |
Implicit | Used to set the value to 0 . |
NotEqual(TSdlAudioDeviceID, TSdlAudioDeviceID) | Used to compare against another TSdlAudioDeviceID. |
NotEqual(TSdlAudioDeviceID, Cardinal) | Used to compare against 0 . |
Methods
Name | Description |
---|---|
GetFormat | Get the device's preferred format (or a reasonable default if this can't be determined). |
Property Descriptions
ChannelMap
The current channel map.
Channel maps are optional; most things do not need them, instead passing data in the order that SDL expects.
Audio devices usually have no remapping applied. This is represented by returning nil, and does not signify an error.
property ChannelMap: TArray<Integer> read GetChannelMap
Type: TArray<Integer>
See Also
Remarks
It is safe to use this property from any thread
DefaultPlaybackDevice
The default playback audio device ID.
class property DefaultPlaybackDevice: TSdlAudioDeviceID read GetDefaultPlaybackDevice
Type: TSdlAudioDeviceID
DefaultRecordingDevice
The default recording audio device ID.
class property DefaultRecordingDevice: TSdlAudioDeviceID read GetDefaultRecordingDevice
Type: TSdlAudioDeviceID
IsPlaybackDevice
Whether this audio device is a playback device (instead of recording).
property IsPlaybackDevice: Boolean read GetIsPlaybackDevice
Type: Boolean
Remarks
It is safe to use this property from any thread
Name
The human-readable name of this audio device.
property Name: String read GetName
Type: String
Exceptions
ESdlError
: Raised on failure.
See Also
Remarks
It is safe to use this property from any thread
PlaybackDevices
A list of currently-connected audio playback devices.
This returns of list of available devices that play sound, perhaps to speakers or headphones ("playback" devices). If you want devices that record audio, like a microphone ("recording" devices), use RecordingDevices instead.
class property PlaybackDevices: TArray<TSdlAudioDeviceID> read GetPlaybackDevices
Type: TArray<TSdlAudioDeviceID>
Exceptions
ESdlError
: Raised on failure.
See Also
Remarks
It is safe to use this property from any thread
RecordingDevices
A list of currently-connected audio recording devices.
This returns of list of available devices that record audio, like a microphone ("recording" devices). If you want devices that play sound, perhaps to speakers or headphones ("playback" devices), use PlaybackDevices instead.
class property RecordingDevices: TArray<TSdlAudioDeviceID> read GetRecordingDevices
Type: TArray<TSdlAudioDeviceID>
Exceptions
ESdlError
: Raised on failure.
See Also
Remarks
It is safe to use this property from any thread
Operator Descriptions
Equal(TSdlAudioDeviceID, TSdlAudioDeviceID)
Used to compare against another TSdlAudioDeviceID.
class operator Equal(const ALeft, ARight: TSdlAudioDeviceID): Boolean; inline; static
Parameters
ALeft
: TSdlAudioDeviceID
ARight
: TSdlAudioDeviceID
Returns
Boolean
Equal(TSdlAudioDeviceID, Cardinal)
Used to compare against 0
.
class operator Equal(const ALeft: TSdlAudioDeviceID; const ARight: Cardinal): Boolean; inline; static
Parameters
ALeft
: TSdlAudioDeviceID
ARight
: Cardinal
Returns
Boolean
Implicit(Cardinal)
Used to set the value to 0
.
class operator Implicit(const AValue: Cardinal): TSdlAudioDeviceID; inline; static
Parameters
AValue
: Cardinal
Returns
NotEqual(TSdlAudioDeviceID, TSdlAudioDeviceID)
Used to compare against another TSdlAudioDeviceID.
class operator NotEqual(const ALeft, ARight: TSdlAudioDeviceID): Boolean; inline; static
Parameters
ALeft
: TSdlAudioDeviceID
ARight
: TSdlAudioDeviceID
Returns
Boolean
NotEqual(TSdlAudioDeviceID, Cardinal)
Used to compare against 0
.
class operator NotEqual(const ALeft: TSdlAudioDeviceID; const ARight: Cardinal): Boolean; inline; static
Parameters
ALeft
: TSdlAudioDeviceID
ARight
: Cardinal
Returns
Boolean
Method Descriptions
GetFormat(TSdlAudioSpec)
Get the device's preferred format (or a reasonable default if this can't be determined).
You can also use this to request the current device buffer size. This is specified in sample frames and represents the amount of data SDL will feed to the physical hardware in each chunk. This can be converted to milliseconds of audio with the following equation:
ms = ((frames * 1000) / spec.freq);
Buffer size is only important if you need low-level control over the audio playback timing. Most apps do not need this.
function GetFormat(out ASpec: TSdlAudioSpec): Integer; inline
Exceptions
ESdlError
: Raised on failure.
Parameters
ASpec
: TSdlAudioSpec
: Will be filled with device details.
Returns
Integer
: The device buffer size, in sample frames.
Remarks
It is safe to call this method from any thread