wasapi

package
v1.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wasapi is the WASAPI backend of the audio service on Windows (SPEC §28.3, step 31.6): playback and capture of float32 frames through the shared mode of the Windows audio engine, driven by events, with the list of devices and the default device from the device enumerator and its notification client (a COM object that Go makes, SPEC §25.2). Every COM call is made on a thread of its own that is in the multithreaded apartment: one thread for the enumerator, and one for each open device. The design follows the WASAPI driver of SDL 3 (src/audio/wasapi/SDL_wasapi.c; zlib license, third_party/sdl/LICENSE), translated to Go and changed: each device has a thread of its own that does everything for it (SDL proxies to a management thread), the stream is made again on the new default device when the default changes, and IAudioClient3 is asked for the period the app wants.

This file and the files without an operating system in their name are plain Go (the choice of the format, the channel masks, the arithmetic of the buffers) and are tested on any host; the calls into Windows are in the files that end in _windows.go.

Flutter: no counterpart

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL