AudioStreamConfig
Constructs an audio stream configuration for playback control.
Parameters
Specifies audio spatialization mode: - AudioChannelLayoutType.STANDARD for traditional layouts (stereo, 5.1, etc.). - AudioChannelLayoutType.AMBISONICS for spherical harmonic-based audio.
Audio group identifier for volume/mixing control.
Required when using STANDARD layout: - Must be non-null if channelLayoutType is STANDARD. - Specify channel arrangement (e.g. OUTPUT_LAYOUT_5_1_2).
Required when using AMBISONICS layout: - Must be non-null if channelLayoutType is AMBISONICS. - Specify Ambisonics format (e.g. ACN_SN3D_1).
PCM format details including: - Sample rate (e.g. 48000). - Bit depth. - Channel count.
Usage example:
// STANDARD configuration
AudioStreamConfig(
AudioChannelLayoutType.STANDARD,
"game_effects",
AudioChannelLayout.OUTPUT_LAYOUT_STEREO,
AmbisonicsType.NONE,
AudioFormat(sampleRate = 48000)
)
// AMBISONICS configuration
AudioStreamConfig(
AudioChannelLayoutType.AMBISONICS,
"environment",
AudioChannelLayout.OUTPUT_LAYOUT_INVALID,
AmbisonicsType.ACN_SN3D_2,
AudioFormat(sampleRate = 96000)
)Throws
if configuration parameters are invalid: - When channelLayoutType is AudioChannelLayoutType.STANDARD and channelLayout is AudioChannelLayout.OUTPUT_LAYOUT_INVALID. - When channelLayoutType is AudioChannelLayoutType.AMBISONICS and ambisonicType is AmbisonicsType.NONE.