Goo.Audio
0.28.4
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Goo.Audio --version 0.28.4
NuGet\Install-Package Goo.Audio -Version 0.28.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Goo.Audio" Version="0.28.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Goo.Audio" Version="0.28.4" />
<PackageReference Include="Goo.Audio" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Goo.Audio --version 0.28.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Goo.Audio, 0.28.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Goo.Audio@0.28.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Goo.Audio&version=0.28.4
#tool nuget:?package=Goo.Audio&version=0.28.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Optional audio
using let file = File.OpenRead("notification.wav")
let cue = SoundSource.LoadWav(file)
let opened = SoundPlayer.TryOpen()
let audio = opened.Player
let queued = audio?.TryPlay(cue, 0.5F)
Add Goo.Audio alongside Goo with the same package version. Types use namespace Goo.
Keep the player at application scope.
| Operation | Contract |
|---|---|
| Open and dispose | Use the UI thread, after Window.ConfigureApplication if used. Owners of the same output share playback state. |
TryOpen().Status |
Opened, Unsupported, SubsystemUnavailable, or DeviceUnavailable. Only Opened carries a player. |
TryPlay().Status |
Queued, VoiceLimit, QueueBudget, or NativeFailure. Only Queued carries playback. |
SoundPlayback.Gain |
Set live gain in [0, 1]. Non-finite or out-of-range gain throws. |
Pause() / Resume() |
Retain queued frames while paused, then continue. |
Status |
Playing, Paused, Completed, Stopped, SourceFailure, or NativeFailure. A query reclaims finished streams. |
Stop() |
Release one stream. Device buffering can briefly outlast control changes. |
StopAll() / player disposal |
Stop only this owner's playback. |
All operations except open and dispose are thread-safe. Invalid arguments and disposed-owner play calls throw. Completion means drained queues, not exact audible timing.
Sources
| Source | Limits and formats |
|---|---|
Immutable SoundSource |
Mono/stereo float PCM, 8000 through 192000 Hz, up to 30 seconds and 16 MiB. |
LoadWav / FromWav |
Unsigned 8-bit PCM, signed 16/24-bit PCM, 32-bit float, and WAVE_FORMAT_EXTENSIBLE carrying these formats. |
| WAV input | Check the 16 MiB encoded limit before allocation. Caller-owned streams stay open. |
| Samples | Clamp finite values to [-1, 1]. Non-finite input throws. |
SoundStreamSource(sampleRate, channels, read) |
Pull interleaved float frames on the audio thread. Streams have no duration limit. |
| Shared queue | The default output and each selected output have separate limits of 16 voices and 32 MiB. |
- The reader gets a reusable 1024-frame buffer and a requested frame count.
- Return frames written. Zero means permanent end. Short reads continue on the next request.
- Do not retain the buffer, block, call playback controls, or access UI state.
- Invalid counts, non-finite samples, and reader exceptions become
SourceFailure. - Consumer code owns compressed decoders, decoder synchronization, looping, seek, and stereo pan.
- Android uses AAudio without SDL. Desktop uses SDL.
- Applications own mute and notification policy.
System UI sounds
let status = SystemSounds.TryPlay(SystemSound.Alert)
- Windows uses system sound aliases. macOS supports alerts through
NSBeep. - Linux uses the optional system
libcanberra.so.0and the installed sound theme. - Android, macOS clicks and missing platform APIs return
Unsupported. Queuedmeans the platform accepted the request. Sound settings can keep it silent.- A native API failure returns
NativeFailure. No PCM device orSoundPlayeris needed.
Output selection
using let outputs = SoundPlayer.EnumerateOutputDevices()
if outputs.Status == SoundDeviceStatus.Enumerated && outputs.Devices.Count > 0 {
using let player = SoundPlayer.TryOpen(outputs.Devices[0]).Player
}
- Desktop enumeration uses SDL. Android returns
Unsupportedand an empty list. - Open a choice before disposing the list. Existing players remain usable after list disposal.
- Names are display labels, not persistent identifiers. Do not retain entries from a disposed list.
- Enumeration returns
Enumerated,Unsupported,SubsystemUnavailableorNativeFailure. - A device unplugged before open returns
DeviceUnavailable. The default open still follows platform routing.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Goo (>= 0.28.4)
- Hexa.NET.SDL3 (>= 1.2.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.31.0 | 0 | 11/14/2026 |
| 0.30.0 | 83 | 11/11/2026 |
| 0.29.1 | 94 | 11/8/2026 |
| 0.29.0 | 89 | 11/8/2026 |
| 0.28.7 | 85 | 11/7/2026 |
| 0.28.6 | 92 | 11/7/2026 |
| 0.28.5 | 96 | 11/7/2026 |
| 0.28.4 | 93 | 11/7/2026 |
| 0.28.3 | 91 | 11/6/2026 |
| 0.28.2 | 116 | 11/6/2026 |
| 0.28.1 | 93 | 11/5/2026 |
| 0.27.11 | 98 | 11/5/2026 |
| 0.27.10 | 95 | 11/4/2026 |
| 0.27.9 | 94 | 11/4/2026 |
| 0.27.8 | 91 | 11/4/2026 |
| 0.27.7 | 93 | 11/3/2026 |
| 0.27.6 | 90 | 11/3/2026 |
| 0.27.5 | 87 | 11/3/2026 |
| 0.27.4 | 88 | 11/3/2026 |
| 0.27.3 | 85 | 11/3/2026 |
Loading failed