[GH-ISSUE #2758] [Proposed fix] A fix for double file extensions #1982

Open
opened 2026-10-20 10:13:41 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @broiswear on GitHub (Feb 12, 2026).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/2758

Hello, I am new to GitHub so I apologize if this isn't formatted perfectly, But, I have found that by default, the WebUI will name the output files "song.wav.wav" if the input file is already a wav. This can potentially cause huge issues for certain softwares that need filenames to be exact and completely unaltered. The added extra "wav" essentially renders the files completely unreadable for those softwares. Therefore, I propose a fix that I have discovered, and it is in the "infer/modules/vc" directory, inside the "modules.py" file.

Essentially, if the end of the file has this code:

            if "Success" in info:
                try:
                    tgt_sr, audio_opt = opt
                    clean_name = os.path.splitext(os.path.basename(path))[0]
                    
                    if format1 in ["wav", "flac"]:
                        sf.write(
                            "%s/%s.%s" % (opt_root, clean_name, format1),
                            audio_opt,
                            tgt_sr,
                        )
                    else: 
                        save_path = "%s/%s.%s" % (
                            opt_root,
                            clean_name,
                            format1,
                        )
                        with BytesIO() as wavf:
                            sf.write(wavf, audio_opt, tgt_sr, format="wav")
                            wavf.seek(0, 0)
                            with open(save_path, "wb") as outf:
                                wav2(wavf, outf, format1)
                except:
                    info += traceback.format_exc()
            infos.append("%s->%s" % (os.path.basename(path), info))
            yield "\n".join(infos)
        yield "\n".join(infos)
    except:
        yield traceback.format_exc()

instead of the current version's original code, then the WebUI RVC will successfully only produce single file extensions instead of duplicating them. This fix took me many hours to figure out and I've found it to be very useful.

Originally created by @broiswear on GitHub (Feb 12, 2026). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/2758 Hello, I am new to GitHub so I apologize if this isn't formatted perfectly, But, I have found that by default, the WebUI will name the output files "song.wav.wav" if the input file is already a wav. This can potentially cause huge issues for certain softwares that need filenames to be exact and completely unaltered. The added extra "wav" essentially renders the files completely unreadable for those softwares. Therefore, I propose a fix that I have discovered, and it is in the "infer/modules/vc" directory, inside the "modules.py" file. Essentially, if the end of the file has this code: if "Success" in info: try: tgt_sr, audio_opt = opt clean_name = os.path.splitext(os.path.basename(path))[0] if format1 in ["wav", "flac"]: sf.write( "%s/%s.%s" % (opt_root, clean_name, format1), audio_opt, tgt_sr, ) else: save_path = "%s/%s.%s" % ( opt_root, clean_name, format1, ) with BytesIO() as wavf: sf.write(wavf, audio_opt, tgt_sr, format="wav") wavf.seek(0, 0) with open(save_path, "wb") as outf: wav2(wavf, outf, format1) except: info += traceback.format_exc() infos.append("%s->%s" % (os.path.basename(path), info)) yield "\n".join(infos) yield "\n".join(infos) except: yield traceback.format_exc() instead of the current version's original code, then the WebUI RVC will successfully only produce single file extensions instead of duplicating them. This fix took me many hours to figure out and I've found it to be very useful.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#1982
No description provided.