Updated README.md
This commit is contained in:
parent
050327f56d
commit
4b226f9601
|
@ -18,9 +18,9 @@
|
||||||
<PackageTags>EonaCat, Audio, Volume, Mixer .NET Standard, Jeroen, Saey</PackageTags>
|
<PackageTags>EonaCat, Audio, Volume, Mixer .NET Standard, Jeroen, Saey</PackageTags>
|
||||||
<PackageReleaseNotes></PackageReleaseNotes>
|
<PackageReleaseNotes></PackageReleaseNotes>
|
||||||
<Description>EonaCat VolumeMixer</Description>
|
<Description>EonaCat VolumeMixer</Description>
|
||||||
<Version>1.0.3</Version>
|
<Version>1.0.4</Version>
|
||||||
<AssemblyVersion>1.0.0.3</AssemblyVersion>
|
<AssemblyVersion>1.0.0.4</AssemblyVersion>
|
||||||
<FileVersion>1.0.0.3</FileVersion>
|
<FileVersion>1.0.0.4</FileVersion>
|
||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
42
README.md
42
README.md
|
@ -86,12 +86,7 @@ using EonaCat.VolumeMixer.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
class Program
|
static async Task Main()
|
||||||
{
|
|
||||||
// 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
|
// Playback management example
|
||||||
using (var volumeMixer = new VolumeMixerManager())
|
using (var volumeMixer = new VolumeMixerManager())
|
||||||
|
@ -182,33 +177,11 @@ class Program
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Error: {ex.Message}");
|
Console.WriteLine($"Error: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Microphone management example:
|
|
||||||
```csharp
|
|
||||||
using EonaCat.VolumeMixer.Managers;
|
|
||||||
using EonaCat.VolumeMixer.Models;
|
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
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()
|
|
||||||
{
|
|
||||||
// Microphone management example
|
|
||||||
using (var micManager = new MicrophoneManager())
|
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Get all microphones
|
// Get all microphones
|
||||||
var microphones = await micManager.GetMicrophonesAsync();
|
var microphones = await volumeMixer.GetMicrophonesAsync();
|
||||||
Console.WriteLine($"Found {microphones.Count} microphones:");
|
Console.WriteLine($"Found {microphones.Count} microphones:");
|
||||||
|
|
||||||
foreach (var mic in microphones)
|
foreach (var mic in microphones)
|
||||||
|
@ -220,7 +193,7 @@ class Program
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default microphone
|
// Default microphone
|
||||||
using (var defaultMic = await micManager.GetDefaultMicrophoneAsync())
|
using (var defaultMic = await volumeMixer.GetDefaultMicrophoneAsync())
|
||||||
{
|
{
|
||||||
Console.WriteLine($"\nSetting default microphone volume to 1%");
|
Console.WriteLine($"\nSetting default microphone volume to 1%");
|
||||||
bool success = await defaultMic.SetMasterVolumeAsync(0.1f);
|
bool success = await defaultMic.SetMasterVolumeAsync(0.1f);
|
||||||
|
@ -250,15 +223,15 @@ class Program
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine($"Default mic volume: {await micManager.GetMicrophoneVolumeAsync():P0}");
|
Console.WriteLine($"Default mic volume: {await volumeMixer.GetMicrophoneVolumeAsync():P0}");
|
||||||
Console.WriteLine($"Default mic muted: {await micManager.GetMicrophoneMuteAsync()}");
|
Console.WriteLine($"Default mic muted: {await volumeMixer.GetMicrophoneMuteAsync()}");
|
||||||
|
|
||||||
// Set microphone volume to 60%
|
// 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}");
|
Console.WriteLine($"Set microphone volume to 60%: {result}");
|
||||||
|
|
||||||
// Set specific microphone by name
|
// 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}");
|
Console.WriteLine($"Set USB microphone volume to 70%: {result}");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -268,5 +241,4 @@ class Program
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
Loading…
Reference in New Issue