Scaffold C# record-play probe + PortAudio device-list spike
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<RootNamespace>RecordPlayProbe</RootNamespace>
|
||||||
|
<AssemblyName>Probe</AssemblyName>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
|
||||||
|
<SelfContained>true</SelfContained>
|
||||||
|
<PublishSingleFile>false</PublishSingleFile>
|
||||||
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="PortAudioSharp2" Version="1.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using PortAudioSharp;
|
||||||
|
|
||||||
|
Environment.SetEnvironmentVariable("PA_ALSA_PLUGHW", "1");
|
||||||
|
|
||||||
|
PortAudio.Initialize();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int count = PortAudio.DeviceCount;
|
||||||
|
Console.WriteLine($"PortAudio version: {PortAudio.VersionInfo.versionText}");
|
||||||
|
Console.WriteLine($"Devices ({count}):");
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
var info = PortAudio.GetDeviceInfo(i);
|
||||||
|
Console.WriteLine(
|
||||||
|
$" [{i}] {info.name} in={info.maxInputChannels} out={info.maxOutputChannels} " +
|
||||||
|
$"defaultSr={info.defaultSampleRate}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
PortAudio.Terminate();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user