SoundVolumeView that displays general information and the current volume level for all active sound components in your system, and allows you to instantly mute and unmute them.
First of all thanks to nirsoft for creating SoundVolumeView.exe. Without this it would not be possible for Windows. https://www.nirsoft.net/utils/sound_volume_view.html
Supported platforms:
- ✅ Windows
- ❌ MacOS
- ❌ Linux
- ❌ Android
- ❌ iOS
- ❌ Web
The instance SoundVolumeView() will look for the executable SoundVolumeView.exe in the compilation files of the program.
If not found, it will throw an PlatformException
specifying the path of the executable.
SoundVolumeView soundVolumeView = SoundVolumeView();
// ...build/windows/runner/Debug/vendors/sound_volume_view.exe // Add the path vendor folder and the executable SoundVolumeView.exe
List<Device> devices = await soundVolumeView.refreshDevices();
/// [captureDevices] You only get the capture devices
soundVolumeView.captureDevices;
/// [outputDevices] You only get the output devices
soundVolumeView.outputDevices;
/// [applicationDevices] You only get the application devices
soundVolumeView.applicationDevices;
await soundVolumeView.unMute( devices[index] );
await soundVolumeView.mute( devices[index] );
await soundVolumeView.setVolume(soundVolumeView.captureDevices[index], 100);
await soundVolumeView.setListenToThisDevice(devices[index], listen: true);
Device outputDevice = soundVolumeView.outputDevices.firstWhere(( device ) => device.itemID == value);
await soundVolumeView.setPlaybackThroughDevice(soundVolumeView.captureDevices[index], outputDevice);
enum DefaultType {
console,
multimedia,
communications,
all
}
Device outputDeviceFound = soundVolumeView.outputDevices.firstWhere((element) => element.itemID == itemId);
await soundVolumeView.setAppDefault(soundVolumeView.applicationDevices[index], device, defaultType: DefaultType.all);
await soundVolumeView.setDefault(soundVolumeView.outputDevices[index], defaultType: DefaultType.all);