Updated README.md
This commit is contained in:
20
README.md
20
README.md
@@ -86,7 +86,12 @@ using EonaCat.VolumeMixer.Models;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
static async Task Main()
|
||||
class Program
|
||||
{
|
||||
// This file is part of the EonaCat project(s) which is released under the Apache License.
|
||||
// See the LICENSE file or go to https://EonaCat.com/License for full license details.
|
||||
[STAThread]
|
||||
static async Task Main()
|
||||
{
|
||||
// Playback management example
|
||||
using (var volumeMixer = new VolumeMixerManager())
|
||||
@@ -119,7 +124,17 @@ using System.Threading.Tasks;
|
||||
foreach (var session in sessions)
|
||||
{
|
||||
Console.WriteLine($"- {session.DisplayName} ({await session.GetProcessNameAsync()})");
|
||||
Console.WriteLine($" Volume: {await session.GetVolumeAsync():P0}");
|
||||
|
||||
if ((await session.GetProcessNameAsync()).Equals("msedge", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Console.WriteLine($" Current Volume: {await session.GetVolumeAsync():P0}");
|
||||
await session.SetVolumeAsync(1f).ConfigureAwait(false);
|
||||
Console.WriteLine($" Set to Volume: {await session.GetVolumeAsync():P0}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($" Volume: {await session.GetVolumeAsync():P0}");
|
||||
}
|
||||
Console.WriteLine($" Muted: {await session.GetMuteAsync()}");
|
||||
session.Dispose();
|
||||
}
|
||||
@@ -241,4 +256,5 @@ using System.Threading.Tasks;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user