RecursiveAI.OneAudio.Devices
1.2.1
dotnet add package RecursiveAI.OneAudio.Devices --version 1.2.1
NuGet\Install-Package RecursiveAI.OneAudio.Devices -Version 1.2.1
<PackageReference Include="RecursiveAI.OneAudio.Devices" Version="1.2.1" />
<PackageVersion Include="RecursiveAI.OneAudio.Devices" Version="1.2.1" />
<PackageReference Include="RecursiveAI.OneAudio.Devices" />
paket add RecursiveAI.OneAudio.Devices --version 1.2.1
#r "nuget: RecursiveAI.OneAudio.Devices, 1.2.1"
#:package RecursiveAI.OneAudio.Devices@1.2.1
#addin nuget:?package=RecursiveAI.OneAudio.Devices&version=1.2.1
#tool nuget:?package=RecursiveAI.OneAudio.Devices&version=1.2.1
RecursiveAI.OneAudio.Devices
Audio device playback and capture for RecursiveAI.OneAudio: WASAPI on Windows, Core Audio on macOS and iOS, ALSA on Linux, over the operating system's own libraries, with no dependencies beyond the .NET base class library.
using OneAudio;
using var mixer = Audio.CreateMixer(); // 48 kHz stereo
using var output = Audio.Play(mixer); // default device, follows default changes
mixer.Play(Audio.Load("shot.ogg"));
Console.WriteLine(output.Counters); // frames written and played, peak, underruns, losses, reopens
The full device API is described in docs/api.md.
Apple notes
- macOS: playback and capture on any Core Audio device, rate and channel conversion handled for you, and the stream follows default-device changes and removal. The system picks the hardware buffer size unless you set
PeriodFramesorBufferFrames. - Microphone: if the user denied access, opening an input fails with a message saying so. A command-line program without an app bundle and a microphone usage description may be unable to ask and receive silence.
- iOS: set
DeviceStreamOptions.AppleSessionto choose the audio-session category (Ambientby default). Interruptions pause the stream and resume it afterwards; the app needs a microphone usage description in its Info.plist to record. NativeAOT output exists for devices (ios-arm64); the simulator runs the Mono build.
Windows (WASAPI)
Shared mode (the default) converts any rate and channel count through the Windows mixer; its engine period is 10 ms by default (Microsoft's documented figure). ShareMode.Exclusive owns the device for lower latency, bounded by the driver's minimum period (a few milliseconds typically, as documented by Microsoft), but needs a format the hardware accepts directly: float32 or 32/24/16-bit integer at exactly your rate and channel count. When it cannot be granted the open is refused with a reason in LastError. A machine with no audio endpoint is the same as any missing device: the output runs silently at real-time pace and retries.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- RecursiveAI.OneAudio (>= 1.2.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RecursiveAI.OneAudio.Devices:
| Package | Downloads |
|---|---|
|
RecursiveAI.OneGame.Audio
Audio device output and the audio service that drives a mixer. |
GitHub repositories
This package is not used by any popular GitHub repositories.