tizen_audio_manager 0.1.1 copy "tizen_audio_manager: ^0.1.1" to clipboard
tizen_audio_manager: ^0.1.1 copied to clipboard

A Flutter plugin that allows setting and getting volume level for different audio types as well as getting current playback type.

tizen_audio_manager #

pub package

A Flutter plugin that allows setting and getting the volume level for different audio types as well as getting current playback type.

Usage #

To use this package, add tizen_audio_manager as a dependency in your pubspec.yaml file.

dependencies:
  tizen_audio_manager: ^0.1.1

Getting and setting the volume level #

Get the maximum volume level for alarm media type:

final level = await AudioManager.volumeController.getMaxLevel(AudioVolumeType.alarm);

Get the current level for alarm media type:

final level = await AudioManager.volumeController.getLevel(AudioVolumeType.alarm);

Set new volume level for alarm media type:

final newLevel = 10;
AudioManager.volumeController.setLevel(AudioVolumeType.alarm, newLevel);

Listening to volume changes #

You can detect volume changes using AudioManager.volumeController.onChanged.

_subscription = AudioManager.volumeController.onChanged.listen((event) {
    final mediaType = event.type;
    final newLevel = event.level;
});
_subscription.cancel();

Getting current playback type #

Use the following code to get currently playing playback type:

final type = await AudioManager.volumeController.currentPlaybackType;
print(type);

Available types #

You can get and set the volume level for the following audio types:

enum AudioVolumeType {
  system,
  notification,
  alarm,
  ringtone,
  media,
  call,
  voip,
  voice,
  none
}

Required privileges #

In order to set the volume, add the following privileges to your tizen-manifest.xml file:

<privileges>
  <privilege>http://tizen.org/privilege/volume.set</privilege>
</privileges>
1
likes
120
pub points
9%
popularity

Publisher

verified publishertizen.org

A Flutter plugin that allows setting and getting volume level for different audio types as well as getting current playback type.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on tizen_audio_manager