Skip to content

process: raise descriptive error when input looks like integer samples#464

Open
gijzelaerr wants to merge 2 commits intospotify:masterfrom
gijzelaerr:detect-integer-samples
Open

process: raise descriptive error when input looks like integer samples#464
gijzelaerr wants to merge 2 commits intospotify:masterfrom
gijzelaerr:detect-integer-samples

Conversation

@gijzelaerr
Copy link
Copy Markdown
Member

Detect when users pass integer-valued audio samples (e.g. raw 16-bit PCM values like -32768 to 32767) to process() instead of the expected floating-point samples in [-1, 1]. The check triggers only when ALL samples are exact integers AND at least one sample falls outside [-1, 1], avoiding false positives on silence or quiet audio.

Closes #407

gijzelaerr and others added 2 commits March 18, 2026 12:11
Detect when users pass integer-valued audio samples (e.g. raw 16-bit PCM
values like -32768 to 32767) to process() instead of the expected
floating-point samples in [-1, 1]. The check triggers only when ALL
samples are exact integers AND at least one sample falls outside [-1, 1],
avoiding false positives on silence or quiet audio.

Closes spotify#407

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Passing integer-valued samples out of range should raise a descriptive error.

1 participant