def _run_conversion(self, in_file, out_file): try: run_rvc(self.selected_model, in_file, out_file) self.root.after(0, lambda: self._play_result(out_file)) except Exception as e: self.root.after(0, lambda: messagebox.showerror("Error", str(e)))
self.status = tk.Label(root, text="Ready", bd=1, relief=tk.SUNKEN, anchor=tk.W) self.status.pack(side=tk.BOTTOM, fill=tk.X) RVC-GUI Voice Models 2 1.2
def show_model_info(self, model_path): info = f"Path: {model_path}\n" info += f"Size: {os.path.getsize(model_path) / (1024*1024):.2f} MB\n" info += f"Modified: {datetime.fromtimestamp(os.path.getmtime(model_path))}\n" # Try to load companion info.json info_json_path = model_path.replace(".pth", ".json") if os.path.exists(info_json_path): try: with open(info_json_path, 'r') as f: data = json.load(f) info += "\nTraining info:\n" for k, v in data.items(): info += f" {k}: {v}\n" except: pass self.info_text.delete(1.0, tk.END) self.info_text.insert(tk.END, info) out_file): try: run_rvc(self.selected_model
# Info frame info_frame = tk.LabelFrame(root, text="Model Info") info_frame.pack(fill=tk.X, padx=10, pady=5) self.info_text = tk.Text(info_frame, height=5, wrap=tk.WORD) self.info_text.pack(fill=tk.BOTH, padx=5, pady=5) str(e))) self.status = tk.Label(root
# Conversion frame convert_frame = tk.Frame(root) convert_frame.pack(fill=tk.X, padx=10, pady=5) tk.Button(convert_frame, text="Load Audio & Convert", command=self.convert_audio).pack(side=tk.LEFT, padx=5) tk.Button(convert_frame, text="Record & Convert", command=self.record_convert).pack(side=tk.LEFT, padx=5) tk.Button(convert_frame, text="Export Model List", command=self.export_list).pack(side=tk.RIGHT, padx=5)
def convert_audio(self): if not self.selected_model: messagebox.showerror("Error", "No model selected") return input_file = filedialog.askopenfilename(filetypes=[("Audio Files", "*.wav *.mp3 *.flac")]) if not input_file: return out_file = tempfile.NamedTemporaryFile(suffix=".wav", delete=False).name self.status.config(text="Converting...") threading.Thread(target=self._run_conversion, args=(input_file, out_file), daemon=True).start()