getVolume static method
Future<double>
getVolume(
- AudioDeviceType audioDeviceType, {
- AudioRole audioRole = AudioRole.multimedia,
Gets the master volume level (0.0 to 1.0) for the current default device of the given type.
Implementation
static Future<double> getVolume(AudioDeviceType audioDeviceType, {AudioRole audioRole = AudioRole.multimedia}) async {
final Map<String, dynamic> arguments = <String, dynamic>{"deviceType": audioDeviceType.index, "role": audioRole.index};
final double? result = await audioMethodChannel.invokeMethod<double>("getAudioVolume", arguments);
return result ?? 0.0;
}