Closed jscheid closed 3 years ago
It sounds like you want to be able to do something like this?
// ... create SRC object with sample rate 44.1k
src.simple(data); // or full
src.outputSampleRate = 48000;
src.simple(data); // or full
Is this correct?
Yes, something like that would be ideal.
Cool. Seems like the easiest way to do this would be to add a setter to the js src object which just calls destroy() + init() on the WASM module.
If you're comfortable doing this, please open a pr! otherwise, I can look into it in the next week or two.
I've worked around it like so: https://gist.github.com/jscheid/0fe0ca86dbecc7a4efb65a604284d1c1
It's a hack but it does work, feel free to close this.
Seems like a feature worth having. Will add within the next week or two.
The other useful improvement would be a way to process multiple streams in parallel (with the full API). This doesn't currently work (efficiently) because there's only a single SRC_STATE
per wasm instance.
Interesting. Curious to see how you would want this used. For organization, would you open a new issue with a bit more detail?
Added support for updating input and output sample rates in 1c90c7e918e1c4a9908f99e94a0cc80de0329bf0
Thanks!
Happy to!
Could the call to
new SRC
somehow be moved out of the promise, so that different sample rates can be chosen without needlessly having to resolve a promise?