Repository navigation
fix(client): pick the channel before resampling stereo files - #4001
Merged
LauraGPT merged 1 commit intoDec 1, 2026
Merged
Conversation
soundfile returns (frames, channels) and librosa resamples the last axis, so the Fun-ASR-Nano file clients resampled a stereo file that was not 16 kHz across its two channels and sent it at its original rate.
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
Port of QwenAudio/Fun-ASR#181, as discussed there.
client_python.pyandclient_test.pyof Fun-ASR-Nano resample before they drop to one channel.soundfile.readreturns(frames, channels)andlibrosa.resampleworks on the last axis, so a stereo file that isn't 16 kHz is resampled across its two channels and sent at its original rate, labelled as 16 kHz. The channel is now picked first. Which channel is sent does not change.The workflow now installs
librosaand also runs whenclient_python.pychanges, and the new test has no skip, so the cases run on 3.10 and 3.12.Type of change
Validation
The new test runs both clients against a local websocket server with one second of stereo, 440 Hz on the left and a louder 880 Hz on the right, at 8, 16, 44.1 and 48 kHz. It checks the number of samples, the pitch and the level. Without the client changes 6 of the 8 cases fail:
The pytest command of
test-example-collection.yml, on Linux with Python 3.10 and 3.12: 37 passed on both.python -m compileall funasr examples testsUser impact
Anyone who streams a stereo recording that isn't 16 kHz with the file client.
Notes for reviewers
No model or real server was used.