11 releases (breaking)

new 0.9.0 Nov 29, 2021
0.7.0 Nov 21, 2021
0.3.0 Jul 8, 2021

#93 in Audio

Download history 51/week @ 2021-08-09 25/week @ 2021-08-16 26/week @ 2021-08-23 36/week @ 2021-08-30 55/week @ 2021-09-06 25/week @ 2021-09-13 8/week @ 2021-09-20 2/week @ 2021-09-27 12/week @ 2021-10-04 23/week @ 2021-10-11 7/week @ 2021-10-18 3/week @ 2021-10-25 45/week @ 2021-11-01 14/week @ 2021-11-08 38/week @ 2021-11-15 61/week @ 2021-11-22

158 downloads per month

MIT license

49KB
985 lines

Wasapi bindings for Rust

The aim of this crate is to provide easy and safe access to the Wasapi API for audio playback and capture.

The presented API is all safe Rust, but structs and functions closely follow the original Windows API.

For details on how to use Wasapi, please see the Windows documentation.

Bindings are generated automatically using the windows crate.

Supported functionality

These things have been implemented so far:

  • Audio playback and capture
  • Shared and exclusive modes
  • Loopback capture
  • Notifications for volume change, device disconnect etc

Included examples

Example Description
playsine Plays a sine wave in shared mode on the default output device.
playsine_events Similar to playsine but also listens to notifications.
loopback Shows how to simultaneously capture and render sound, with separate threads for capture and render.
record Records audio from the default device, and saves the raw samples to a file.

Dependencies

~229MB
~3.5M SLoC