AVAudioSession¶
Inherits: RefCounted < Object
Controls the shared iOS/tvOS audio session from GDScript.
Description¶
Use this helper to select one of Apple’s predefined AVAudioSession categories so your Godot project can mix or duck audio according to platform expectations. It is most useful on mobile builds where the engine needs to share the audio device with the system music player or with voice chat as described in GameCenterGuide.md. See Apple’s audio session overview at Apple’s AVAudioSession reference.
Properties¶
|
Enumerations¶
enum SessionCategory: 🔗
SessionCategory ambient = 0
Plays audio quietly and mixes with other apps, ideal for games that should respect background music.
SessionCategory multiRoute = 1
Allows simultaneous input and output on multiple ports such as iPad USB headsets and speakers.
SessionCategory playAndRecord = 2
Enables full duplex audio for gameplay that records the microphone while playing effects.
SessionCategory playback = 3
Optimised for playback only and silences system music while your game is active.
SessionCategory record = 4
Recording-only mode for utilities that only capture audio.
SessionCategory soloAmbient = 5
Similar to ambient but pauses other audio sessions when your project starts.
SessionCategory unknown = 6
Default fallback when the platform does not expose audio sessions (macOS desktop).
Property Descriptions¶
Selects the Apple audio session category. Use one of the SessionCategory constants to decide whether your game mixes with other apps, records audio, or routes voice chat.