diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/play.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/play.zig b/examples/play.zig index acb5dad..7297181 100644 --- a/examples/play.zig +++ b/examples/play.zig @@ -25,6 +25,7 @@ const zeal = @import("zeal"); const alc = zeal.alc; const Device = zeal.Device; const Context = zeal.Context; +const Audio = zeal.Audio; const useContext = zeal.useContext; const Buffer = zeal.Buffer; const Source = zeal.Source; @@ -37,11 +38,13 @@ pub fn main() !void { var argv = args(); allocator.free(try argv.next(allocator).?); - const filename = try argv.next(allocator).?; - defer allocator.free(filename); + const path = try argv.next(allocator).?; + defer allocator.free(path); + const audio = try Audio.read(allocator, path); + defer audio.free(); try useContext(context); - const buffer = try Buffer.init(allocator, context, filename); + const buffer = try Buffer.init(context, audio); defer buffer.deinit() catch unreachable; const source = try Source.init(context); |