Closed tortis closed 2 months ago
Hey, thanks for submitting this issue. After reviewing the implementation, I think you're correct in identifying that I didn't provide what you would need to properly read dataOut
. I imagine the best way to do this would be to add a third argument, something like outLength: { length: number } = { length: 0 }
that we could reference following a call to full
to determine how much to slice. I wouldn't want to break the existing API by change the return val.
I don't have time in the nearish future to implement this, but if you're able and have the time, I think it'd be great to add this.
I like it, I just opened PR with this change. I did a build/pack and installed it into my project and was able to use it successfully.
I opted to include sample and frame count just for convenience and clarity, but we can change it back to just length if you'd prefer.
Fixed in #144. 2.1.2 is live on NPM.
Thanks for your contributions!
Summary
I'm using the full API with a reused buffer which is much larger than the expected number of samples.
After I run:
How do I know how much data is in the resampleBuffer. I looked at the source briefly and it doesn't appear to slice the Float32Array or return the number of samples in any other way.
Is there a way to deal with this, or does the library need to be updated to support this use case?