Repository navigation
Conversation
… any_to_mp3 any_to_mp3() converts WeChat-style silk audio via sil_to_wav(any_path, any_path), then reassigned any_path = mp3_path before decoding. That made AudioSegment.from_file() open the output path, which does not exist until export() runs at the end, so every .sil/.silk/.slk upload in the speech-to-text node failed with FileNotFoundError. Keep any_path pointing at the decoded wav written in place and export the mp3 to mp3_path as before. The speech-to-text node (base_speech_to_text_ node.py) already passes distinct temp paths, so no caller changes. Signed-off-by: simpleqt <2015900818@qq.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Bug
any_to_mp3()fails withFileNotFoundErrorfor every.sil/.silk/.slkaudio file, so WeChat-style voice uploads cannot be converted by the speech-to-text workflow node (base_speech_to_text_node.pycallsany_to_mp3for all uploaded audio).Root cause (
apps/common/utils/common.py,any_to_mp3):sil_to_wav(any_path, any_path)decodes the silk file in place, so the decoded wav lives atany_path. The reassigned line madeany_path = mp3_pathbeforeAudioSegment.from_file()runs, butmp3_pathis only created by theaudio.export(mp3_path, ...)call at the end of the function — pydub opens a file that does not exist yet, and every silk upload raisesFileNotFoundError.Fix
Drop the reassignment. After
sil_to_wavthe decoded wav is already in place atany_path, which is exactly what the non-silk branch reads; the mp3 is then exported tomp3_pathas before. No caller changes (callers already pass distinct temp paths).Verification
Standalone repro (this area of the repo has no test suite): it stubs
sil_to_wavwith a real stdlib-WAV writer and exercisesAudioSegment.from_filerouting the same way pydub does (opens the requested path before probing the format).5290738):RED: FileNotFoundError -> [Errno 2] No such file or directory: '...voice.mp3'GREEN, call sequencesil_to_wav -> from_file(voice.silk, 48044 bytes) -> export(voice.mp3)ruff==0.15.12 check apps/common/utils/common.py(repo-pinned version) passes on base and with the fix.Not run locally: the full Django/Celery app (needs PostgreSQL + Redis) and a real pysilk/ffmpeg decode; the repro stubs those two boundaries and mirrors their file-handling behavior.
The same reassignment is also present on the
v3branch.