sysaudio: initial macOS support (CoreAudio) (#741)

This commit is contained in:
Ali Chraghi 2023-04-08 21:57:49 +03:30 committed by GitHub
parent 894b06f01d
commit fbd2ba78f9
Failed to generate hash of commit
10 changed files with 552 additions and 25 deletions

View file

@ -178,7 +178,7 @@ pub const Context = struct {
.trigger_done = null,
};
pub fn createPlayer(self: *Context, device: main.Device, writeFn: main.WriteFn, options: main.Player.Options) !backends.BackendPlayer {
pub fn createPlayer(self: *Context, device: main.Device, writeFn: main.WriteFn, options: main.StreamOptions) !backends.BackendPlayer {
const thread = lib.pw_thread_loop_new(device.id, null) orelse return error.SystemResources;
const media_role = switch (options.media_role) {
@ -265,7 +265,7 @@ pub const Context = struct {
.channels = device.channels,
.format = .f32,
.sample_rate = options.sample_rate,
.write_step = main.Format.frameSize(.f32, 2),
.write_step = main.Format.frameSize(.f32, device.channels.len),
};
return .{ .pipewire = player };
}