The "additional checks" would be to find the min of input and output lengths, and to copy only that number of items. Something like:
nitems = min(len(input_items[0]), len(output_items[0]))
out[:nitems] = in[:nitems]
As your block gets more complex, the checks/limits may get more complex.
On Wed, May 26, 2021 at 7:56 PM Elmore Family <wa4ywm@comcast.net> wrote:
Jeff,This didn't work – same error.JimThe framework can give you different size input and output buffers. In this case, you would:nitems = len(input_items[0])out[:nitems] = input_items[0]You may have to do more checks, of course, because input could be larger than output.On Tue, May 25, 2021 at 5:03 PM Elmore's <wa4ywm@comcast.net> wrote:I am attempting to add an OOT module to my flowgraph. I have generated a General block which I want to place between an Audio Source and a Multiply Constant.The Audio Source is set at a 48K sample rate. Input and Output are float.As a test (I have never tried using an OOT module before) I said:out[:] = input_items[0]in an attempt to simply feed the input to the output unmodified.I get a run time error:ValueError: Could not broadcast input array from shape(4800) into shape(256)Obviously I don't know how to perform the simplest possible operation. What is wrong here?I have tried looking on forums and reading some of the GNU docs but no joy.Thanks for any help.Jim
Virus-free. www.avg.com
No comments:
Post a Comment