Switch audio tracks
Learn how to discover and switch between audio tracks in the FastPix Android Player.
FastPixPlayer can discover and switch audio tracks, commonly available on HLS streams with multiple audio renditions.
AudioTrack properties
Each AudioTrack includes the following properties (useful for building a UI):
id— pass this tosetAudioTrack(id)to switch tracks.languageCode/languageName/label— display in your language menu.isSelected,isPlayable,isDefault— for UI state.- Optional diagnostics:
role,channels,codec,bitrate,groupId.
Listen for audio track updates
Switch audio track by ID
Note: If a seek is in progress, the SDK defers switching until the seek completes.
Set a default audio language
Set a preferred audio language that applies automatically when tracks become available. This never overrides a manual selection:
Use BCP-47 / ISO language names like "English", "Hindi", "French". If the preferred language doesn’t exist in the stream, the player keeps its normal selection.