- Audio Manager: Handles system-level audio controls like volume, mute, and device management.
- Audio Playback: Enables audio stream playback with configurable attributes.
- Audio Focus Management: Manages audio focus for different audio streams.
- Volume and mute control for different audio types
- Audio device management
- System sound management
- Audio focus handling
- Audio stream configuration and management
Get started
Setup
- Add the following library dependency to the
dependenciessection of your package.json file.
-
Add the following privilege and services request in your manifest.toml.
needs Section.
Usage
Import the KeplerAudioInterface turbo module into your project.Audio
Manage Audio VolumeEvent Observers
Audio Manager eventsTroubleshooting
-
Permission issues:
- Error: No Permission exception
- Solution: Make sure that you have declared the required privileges in your manifest.toml.
-
AudioManager not created:
- Error:
getAudioManager()returns undefined - Solution: Make sure that you have properly set up the KeplerAudioInterface Turbo Module is properly in your app environment.
- Error:
-
Invalid Observer or callback:
- Error: “not invoking Callback”
- Solution: Make sure that you are correctly subscribing to the Observers.
-
Unsubscription failures:
- Error: Unsubscribe rejection
- Solution: Check that you’re using the correct observer object and that it isn’t already being used to unsubscribe.
Support
- For specific issues or bugs, please contact the Audio development support team.
API Reference
Classes
- AudioAttributes — Determines the audio attributes to build the audio playback stream with, affects things like content type, usage, and flags.
- AudioConfig — Determines the audio configuration to build the audio playback stream with, affects things like audio sample rate, and format.
- AudioConfigAttr — AudioConfig to retrieve the supported configurations
- AudioDeviceInfo — Data type that contains the description of an audio device
- AudioFocusAttributes — AudioFocusAttributes used while requesting AudioFocus
- AudioFocusManager — Audio Focus Manager allows the creation and destruction of Audio Focus Sessions.
- AudioFocusSession — Audio Focus Session allows audio focus management such as requesting audio focus and
- AudioManager — Audio Manager allows audio management such as volume adjustment and mute control.
- AudioPlaybackStream — Audio Playback Stream allows for control of playback streams such as pausing,
- AudioPlaybackStreamBuilder — Audio Playback Stream Builder allows for the configuration, creation, and destruction
- AudioRecordStream
- AudioRecordStreamBuilder — ## Required Privileges
- AudioTheme — AudioTheme object
- SinkPolicies — SinkPolicies object
Enumerations
- AudioChannelMask — Enum for Audio Channel Mask
- AudioContentType — Enum for audio content type
- AudioDevice — Available audio devices to be used
- AudioEvent — Enum for Audio Event
- AudioFadeType — Audio fade curve types for volume transitions.
- AudioFlags — Enum for Audio Flags
- AudioFocusChange — Each value represents a different type of audio focus change event that can occur,
- AudioFocusStatus — Represents different statuses that can occur when an audio focus call is made.
- AudioPlaybackEvent — Possible playback events used by the playback builder
- AudioRecordEvent — Enum for Audio Record Event
- AudioRole — The possible role of an audio device
- AudioSampleFormat — Enum for Audio Sample Format
- AudioSampleRate — Enum for Audio Sample Rate
- AudioSource — Possible audio sources
- AudioStatus — Enum for audio status code.
- AudioSystemSound — Available system sound types to be used
- AudioTelephonyMode — Available Telephony modes
- AudioUsageType — Enum for Audio Usage Types
- AudioVolumeFlags — Each value represents a different type of audio volume flag. If SHOW_UI is set, a separate
- AudioVolumeType — Each value represents a different volume type like media, voice call, navigation, etc.
- DuckingMode — Struct whose
valuefield is used to signify the Audio Ducking Mode - SampleLayout — Enum to indicate the Audio Sample Layout
- SinkFormatsSelectionPolicy — Struct whose
valuefield is used to signify the User Audio Mode for HDMI output - StreamDuckingPolicy — Available audio ducking policies
- VolumeUpdate — Enum used for the Audio Volume Update Type

