about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/brr.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/brr.zig b/src/brr.zig
index 75dc59d..cfd6f1f 100644
--- a/src/brr.zig
+++ b/src/brr.zig
@@ -5,6 +5,9 @@ const c = @cImport({
 });
 
 pub const snd_pcm_info_t = extern struct {};
+pub extern fn snd_pcm_info_malloc(pcm_info: *snd_pcm_info_t) void;
+pub extern fn snd_pcm_info(pcm: *c.snd_pcm_t, pcm_info: *snd_pcm_info_t) c_int;
+pub extern fn snd_pcm_info_free(pcm_info: *snd_pcm_info_t) void;
 
 pub fn brr(file: []const u8) !void {
     _ = c.mpg123_init();
@@ -71,10 +74,10 @@ pub fn brr(file: []const u8) !void {
             std.log.err("Failed to write to ALSA device", .{});
             // TODO: figure out how to deal with opaque status
             var pcm_info: snd_pcm_info_t = snd_pcm_info_t{};
-            _ = c.snd_pcm_info_malloc(&pcm_info);
-            // _ = c.snd_pcm_info(pcm, &pcm_info);
+            snd_pcm_info_malloc(&pcm_info);
+            _ = snd_pcm_info(pcm, &pcm_info);
 
-            defer c.snd_pcm_info_free(&pcm_info);
+            defer snd_pcm_info_free(&pcm_info);
             std.log.debug("pcm status is {any}", .{pcm_info});
             return;
         } else {