Skip to content

Replace sox with ffmpeg for audio conversion and filtering#2

Merged
kookster merged 2 commits intomainfrom
feat/replace-sox-with-ffmpeg
Apr 8, 2026
Merged

Replace sox with ffmpeg for audio conversion and filtering#2
kookster merged 2 commits intomainfrom
feat/replace-sox-with-ffmpeg

Conversation

@kookster
Copy link
Copy Markdown
Member

@kookster kookster commented Apr 2, 2026

Use ffmpeg for converting audio to raw PCM and for bandpass filtering.

The filter options between the 2 are not quite the same - the bandpass filter in ffmpeg is not equivalent.

This implementation uses ffmpeg's sinc FIR kernel generator with afir convolution, which closely matches sox's sinc filter quality (steep rolloff, flat passband, linear phase).

Makes the change to the code, and updates README and CI workflow to reference ffmpeg instead of sox.

Use ffmpeg for converting audio to raw PCM and for bandpass filtering.
The bandpass filter uses ffmpeg's sinc FIR kernel generator with afir
convolution, which closely matches sox's sinc filter quality (steep
rolloff, flat passband, linear phase).

Updates README and CI workflow to reference ffmpeg instead of sox.
@kookster kookster requested a review from farski April 2, 2026 21:52
Copy link
Copy Markdown
Member

@farski farski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the caveat that I didn't investigate those FFmpeg filters very much, and I have no experience with FIR, this all seems reasonable

The irnorm option was added in ffmpeg 7.x. Dropping it makes the
bandpass filter work with Ubuntu's ffmpeg 6.1.1 package without
affecting detection results.
@kookster kookster merged commit 71e5658 into main Apr 8, 2026
3 checks passed
@kookster kookster deleted the feat/replace-sox-with-ffmpeg branch April 8, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants