Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
generate(..., fs=8000)orfs=48000runs with VAD and a speaker model, speaker inference receives the original source rate even though its input segments have already been resampled. CAMPPlus then resamples them a second time. A padded 1.5-second, 16 kHz segment contains 24,000 samples; passingfs=48000changes it to 8,000 samples before feature extraction.Pass the actual segment rate to speaker inference, matching the existing ASR boundary. Add regressions for arrays and explicit PCM, single and batched inputs, constructor/per-call precedence, conflicting speaker configuration, subsequent default calls, and caller-owned config preservation. This completes the speaker boundary left outside the VAD→ASR rate fix in #3751.
Related issue: #3762
Type of change
Validation
66d7a4c264a5993a2a63ed00c1f402c296ee521a21 failed / 8 passed; fixed source 29 passed.AutoModel.generate→ CAMPPlus reproduction: 8,000 samples before / 24,000 samples after for a 48 kHz source.python -m compileall funasr examples testsE9,F63,F7,F82) andgit diff --checkpass./proc/self/staton macOS, and an existing frontend STFT path reportsWindow size mismatch: 512 != 400. No checks were skipped or dependency declarations changed to bypass them.python -m build --no-isolation: sdist and wheel built successfully; the packagedauto_model.pyin both archives matches the tested fixed file byte-for-byte.User impact
Preserves the waveform duration and content entering speaker feature extraction when callers provide non-16 kHz source audio, or when speaker config contains a conflicting source rate.
Notes for reviewers
Production change is one line. Tests use synthetic 440 Hz waves or silence and lightweight VAD/ASR/embedding stand-ins, with real input conversion/resampling, VAD slicing, speaker chunking, and CAMPPlus inference orchestration. The matrix captures the feature boundary; the constructor/config test also runs real speaker feature extraction. No weights are downloaded. Acoustic recognition quality, diarization quality, accelerator execution and arbitrary ASR frontend rates were not evaluated. Tested frontend rate is 16 kHz.
Prepared with AI assistance; all stated local results are from the current source checkout.