Emerald::Docs::PREMIUM_FEATURES::MultiTrackMedia
Multi-Track Audio & Video Streams
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Overview | .topic_01_overview |
Managing multi-track audio and video streams. |
| Audio Track Switching & Lip-Sync | .topic_02_audio_track_switching |
Selecting dub tracks and adjusting audio delay. |
| Video Angle Switching | .topic_03_video_angle_switching |
Switching between video streams or camera perspectives. |
Class methods
topic_01_overview
Overview: Managing multi-track audio and video streams.
Professional media containers like MKV and MP4 often contain multiple audio language dubs (e.g. English, French, Japanese, Director's Commentary) and alternate video angles. Emerald allows selecting tracks on the fly without stopping or reloading the media.
topic_02_audio_track_switching
Audio Track Switching & Lip-Sync: Selecting dub tracks and adjusting audio delay.
# List all available audio streams
player.audio_tracks.each do |track|
Godot.print("Audio [#{track.id}]: #{track.name} (#{track.channel_layout})")
end
# Switch to Japanese audio track
player.select_audio_track(2)
# Fine-tune lip-sync offset (-100ms or +100ms)
player.set_audio_delay(-100_i64)
topic_03_video_angle_switching
Video Angle Switching: Switching between video streams or camera perspectives.
# Switch to alternate camera angle
player.select_video_track(1)