attachToEntityWithAudioTrack
Attaches spatial audio to an Entity using an already-created AudioTrack.
When to use: Use this method when the AudioTrack is already created by an external framework (e.g., ExoPlayer, MediaPlayer) and you cannot control the Builder phase. The AudioTrack is immediately bound to the target Entity's position.
Usage steps:
Configure spatial audio mode via spatialAudioTrackExtensionConfig before creating the AudioTrack.
Create/configure the AudioTrack through your media framework.
Call this method to bind the AudioTrack to the target Entity's position.
Parameters
entityToAttach
The entity to attach spatial audio to.
audioTrack
The AudioTrack to bind.
Throws
IllegalStateException
if attachment fails.