Something went wrong. Try again.
Plays short audio files such as a terminal bell through PipeWire on Linux and WASAPI on Windows.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! WASAPI in shared mode, through zig-wsapi. The stream is in the alerts//! category, and follows the default device when it changes.
const std = @import("std");const wasapi = @import("wasapi");const StreamOptions = @import("options.zig").StreamOptions;
pub const Stream = wasapi.Stream;pub const Error = wasapi.errors.OpenError;
pub fn open(gpa: std.mem.Allocator, io: std.Io, options: StreamOptions) Error!*Stream { return wasapi.Stream.open(gpa, io, .{ .name = options.name, .channels = options.channels, .rate = options.rate, .role = .notification, .process = .{ .ctx = options.process.ctx, .func = options.process.func }, });}
pub fn close(stream: *Stream, io: std.Io) void { stream.close(io);}
pub fn pause(stream: *Stream) void { stream.pause();}
pub fn unpause(stream: *Stream) void { stream.unpause();}