Sitelet https://github.com/resemble-ai/Resemblyzer/pull/101
Skip to content

Clip out-of-range audio before the voice activity check - #101

Open
SashaMIT wants to merge 1 commit into
resemble-ai:masterfrom
SashaMIT:codered-int16-clip
Open

SashaMIT wants to merge 1 commit into
resemble-ai:masterfrom
SashaMIT:codered-int16-clip

Conversation

@SashaMIT

Copy link
Copy Markdown

trim_long_silences packs the waveform as 16-bit samples for the voice activity check. A sample of 1.5 came back as -16386, and -1.5 came back as 16386. The values wrap past the 16-bit range, so the check hears a different signal.

Out-of-range samples are clipped. 1.5 stays 32767. -1.5 stays -32767. 1.0, -1.0, and 0.0 stay 32767, -32767, and 0.

Test plan

  • test_out_of_range_samples_do_not_wrap is red on the old cast (1.5 is -16386) and green after the clip
  • In-range samples 1.0, -1.0, and 0.0 are unchanged

A sample of 1.5 was cast to a negative 16-bit value, so the activity check heard a wrapped signal.
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.

1 participant