allow for stereo input (unused, though)

This commit is contained in:
Luna 2019-07-13 16:40:08 -03:00
parent 387984bff1
commit f07c989407
2 changed files with 23 additions and 2 deletions

View file

@ -72,8 +72,14 @@ pub const RunContext = struct {
return ImageError.InstantiateFail;
}
// we allocate []f32 with size 2 to account for stereo plugins, however
// we only use &in_buf[0] and &out_buf[0], and don't use the
// (supposedly) right side of neither input or output.
var in_buf = try allocator.alloc(f32, 2);
std.mem.secureZero(f32, in_buf);
return RunContext{
.in_buf = try allocator.alloc(f32, 1),
.in_buf = in_buf,
.out_buf = try allocator.alloc(f32, 2),
.instance = instance.?,
};