tizen_audio_manager

Creator: coderz1093

Last updated:

0 purchases

tizen_audio_manager Image
tizen_audio_manager Images

Languages

Categories

Add to Cart

Description:

tizen audio manager

tizen_audio_manager #

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
copied to clipboard
Getting and setting the volume level #
Get the maximum volume level for alarm media type:
final level = await AudioManager.volumeController.getMaxLevel(AudioVolumeType.alarm);
copied to clipboard
Get the current level for alarm media type:
final level = await AudioManager.volumeController.getLevel(AudioVolumeType.alarm);
copied to clipboard
Set new volume level for alarm media type:
final newLevel = 10;
AudioManager.volumeController.setLevel(AudioVolumeType.alarm, newLevel);
copied to clipboard
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();
copied to clipboard
Getting current playback type #
Use the following code to get currently playing playback type:
final type = await AudioManager.volumeController.currentPlaybackType;
print(type);
copied to clipboard
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
}
copied to clipboard
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>
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.