camilladsp icon indicating copy to clipboard operation
camilladsp copied to clipboard

file backend: synchronous resampler cuts samples at the end of stream

Open Wang-Yue opened this issue 2 years ago • 1 comments

test file:

---
devices:
  samplerate: 96000
  chunksize: 1024
  enable_resampling: true
  resampler_type: Synchronous # or AccurateAsync
  capture_samplerate: 44100
  playback:
    type: File
    channels: 1
    filename: "result.raw"
    format: S16LE
  capture:
    type: File
    channels: 1
    filename: "test.wav"
    format: S16LE
    extra_samples: 1000
Screen Shot 2022-05-30 at 0 02 10

Here's the wave form of 1) original audio 2) audio generated by the above script but with AccurateAsync resampler 3) audio generated by the above script (using FFT).

the sinc interpolation works well. the fft cuts off the last few samples.

Wang-Yue avatar May 29 '22 15:05 Wang-Yue

Thanks for reporting! Currently the extra samples are not run through the resampler, this would be needed to ensure that all samples are flushed from it.

HEnquist avatar May 29 '22 22:05 HEnquist

This should be fixed by https://github.com/HEnquist/camilladsp/commit/db8b696665284b61ab73251a878227cd8548e4e8

HEnquist avatar Nov 15 '22 21:11 HEnquist