audio: improve soundio-sine-wave example

This commit is contained in:
alichraghi 2022-07-08 00:41:06 +04:30 committed by Stephen Gutekanst
parent d5e4c41266
commit 751cceb94a

View file

@ -56,8 +56,7 @@ pub fn main() !void {
try sio.connect(); try sio.connect();
sio.flushEvents(); sio.flushEvents();
const default_output_index = sio.defaultOutputDeviceIndex().?; const default_output_index = sio.defaultOutputDeviceIndex() orelse return error.NoOutputDeviceFound;
if (default_output_index < 0) return error.NoOutputDeviceFound;
const device = sio.getOutputDevice(default_output_index) orelse return error.OutOfMemory; const device = sio.getOutputDevice(default_output_index) orelse return error.OutOfMemory;
defer device.unref(); defer device.unref();