setAudioMediaRole method

Future<void> setAudioMediaRole(
  1. bool enable
)
inherited

Whether mpv reports a "music" media role to the OS audio server (mpv's audio-set-media-role). On PulseAudio and PipeWire (Linux) this lets the server apply the right routing and volume profile for music. On Android the audiotrack driver, and aaudio from API 28, only tag the content type as music: the usage stays media, so routing and volume do not change. Other drivers ignore it.

Implementation

Future<void> setAudioMediaRole(bool enable) async {
  await _gate();
  await _calls.prop('audio-set-media-role', enable ? 'yes' : 'no');
  _updateField(
    (s) => s.copyWith(audioMediaRole: enable),
    _reactives.audioMediaRole,
    enable,
  );
}