This PR fixes the issue that occurs when passing a square (i.e.: (x, x)) buffer into a Plugin instance. Like https://github.com/spotify/pedalboard/pull/338, this PR adds caching of the last-detected channel layout to each Plugin instance, making the following example pass:
board = Pedalboard([Reverb(), Gain()])
with AudioFile("file_with_17_stereo_samples.wav") as f:
while f.tell() < f.frames:
# Read three frames at a time; but the last frame will
# end up with only two samples in it.
output = board(f.read(3), f.samplerate)
Prior to this PR, the above example would have failed as the last f.read(3) call would return an array of shape (2, 2).
Hey @psobot, thank you for fixing this. Does this PR include the "memorization" feature as in the AudioFile scenario, i.e. process (n, 0) or (0, n) to hint the layout for the next buffer call?
Fixes #336. (cc @mttbernardini)
This PR fixes the issue that occurs when passing a square (i.e.:
(x, x)
) buffer into aPlugin
instance. Like https://github.com/spotify/pedalboard/pull/338, this PR adds caching of the last-detected channel layout to eachPlugin
instance, making the following example pass:Prior to this PR, the above example would have failed as the last
f.read(3)
call would return an array of shape(2, 2)
.