Fixed session info retrieval
This commit is contained in:
@@ -99,15 +99,11 @@ class Program
|
||||
{
|
||||
Console.WriteLine($"Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Microphone management example
|
||||
using (var micManager = new MicrophoneManager())
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get all microphones
|
||||
var microphones = await micManager.GetMicrophonesAsync();
|
||||
var microphones = await volumeMixer.GetMicrophonesAsync();
|
||||
Console.WriteLine($"Found {microphones.Count} microphones:");
|
||||
|
||||
foreach (var mic in microphones)
|
||||
@@ -119,7 +115,7 @@ class Program
|
||||
}
|
||||
|
||||
// Default microphone
|
||||
using (var defaultMic = await micManager.GetDefaultMicrophoneAsync())
|
||||
using (var defaultMic = await volumeMixer.GetDefaultMicrophoneAsync())
|
||||
{
|
||||
Console.WriteLine($"\nSetting default microphone volume to 1%");
|
||||
bool success = await defaultMic.SetMasterVolumeAsync(0.1f);
|
||||
@@ -149,15 +145,15 @@ class Program
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"Default mic volume: {await micManager.GetMicrophoneVolumeAsync():P0}");
|
||||
Console.WriteLine($"Default mic muted: {await micManager.GetMicrophoneMuteAsync()}");
|
||||
Console.WriteLine($"Default mic volume: {await volumeMixer.GetMicrophoneVolumeAsync():P0}");
|
||||
Console.WriteLine($"Default mic muted: {await volumeMixer.GetMicrophoneMuteAsync()}");
|
||||
|
||||
// Set microphone volume to 60%
|
||||
bool result = await micManager.SetMicrophoneVolumeAsync(0.6f);
|
||||
bool result = await volumeMixer.SetMicrophoneVolumeAsync(0.6f);
|
||||
Console.WriteLine($"Set microphone volume to 60%: {result}");
|
||||
|
||||
// Set specific microphone by name
|
||||
result = await micManager.SetMicrophoneVolumeByNameAsync("USB", 0.7f);
|
||||
result = await volumeMixer.SetMicrophoneVolumeByNameAsync("USB", 0.7f);
|
||||
Console.WriteLine($"Set USB microphone volume to 70%: {result}");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user