SystemAudioRepository

class SystemAudioRepository(application: Context, mediaRouter: MediaRouter, selector: MediaRouteSelector = MediaRouteSelector.Builder().build()) : AudioOutputRepository, VolumeRepository

Audio Repository for identifying and controlling available audio devices in a simple manner.

Constructors

Link copied to clipboard
constructor(application: Context, mediaRouter: MediaRouter, selector: MediaRouteSelector = MediaRouteSelector.Builder().build())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val audioOutput: StateFlow<AudioOutput>

The current audio output.

Link copied to clipboard
open override val available: StateFlow<List<AudioOutput>>

The list of available audio output devices.

Link copied to clipboard
open override val volumeState: StateFlow<VolumeState>

The current volume state, including volume, min, max.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun decreaseVolume()

Decrease the volume of the current audio output.

Link copied to clipboard
open override fun increaseVolume()

Increase the volume of the current audio output.

Link copied to clipboard
open override fun launchOutputSelection(closeOnConnect: Boolean)

Action to launch output selection by the user.

Link copied to clipboard
open override fun setVolume(volume: Int)

Sets the volume of the current audio output.