WaveBeans / wavebeans

Audio Processing. On scale.
https://wavebeans.io
Apache License 2.0
24 stars 0 forks source link

Resampling stream #15

Closed asubb closed 3 years ago

asubb commented 4 years ago

Sometimes there is gonna be a need when the stream should be resampled. It might be good implementation for down/up sampling as well as some manual needs, i.e. for implementing custom down/up sampling.

Limitations:

  1. Streams with different sample rates are not compatible. The check is performed during runtime (and potentially when topology is being planned).

Potential API

stream44100
  .resample(to = 22050.0f) // downsample
  .times(2) // do some processing
  .resample(to = 96000.0f, withFunction = { /* ... */ }) // upsample using custom function
  .out(sampleRate = 96000) // requires to be 96000Hz