diff options
author | makefunstuff <[email protected]> | 2024-07-04 09:29:15 +0200 |
---|---|---|
committer | makefunstuff <[email protected]> | 2024-07-04 09:29:15 +0200 |
commit | c3f6700f383bd1248626071e450eb6a6da08b8d4 (patch) | |
tree | 5ba5d77edddccb11041e8d2948676d9376bc57b3 | |
parent | dde71be0e70e4a4f4ae6a3af360449039cd2cf49 (diff) | |
download | tinkerbunk-c3f6700f383bd1248626071e450eb6a6da08b8d4.tar.gz |
extending struct
-rw-r--r-- | src/brr.zig | 9 |
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 { |