cutterbl / soundtouchjs-audio-worklet

AudioWorkletNode and AudioWorkletProcessor implementing SoundTouchJS
GNU Lesser General Public License v2.1
70 stars 10 forks source link

fix: Correct early audio cutoff and handle single channel audio #20

Closed onnowhere closed 1 year ago

onnowhere commented 1 year ago

Currently audio files cut off slightly early, and single channel audio files fail to play.

This adjusts the logic so that extraction returns the full numFrames and the cutoff logic is instead handled by isNaN checks on the samples. It also simply duplicates the left channel if there is only one channel available.

Test file for comparison: https://github.com/onnowhere/soundtouchjs-audio-worklet/releases/download/test/test.mp3