except Exception as e: self.status_label.config(text="Conversion failed", fg="red") messagebox.showerror("Error", str(e))
self.input_file = tk.StringVar() self.output_format = tk.StringVar(value="mp3") self.bitrate = tk.StringVar(value="192k") self.output_dir = tk.StringVar()
def convert(self): self.convert_btn.config(state=tk.DISABLED) self.progress.start() self.status_label.config(text="Converting...") jovo audio converter
try: # Load audio ext = input_path.split('.')[-1].lower() audio = AudioSegment.from_file(input_path, format=ext)
thread = threading.Thread(target=self.convert) thread.start() except Exception as e: self
# Convert button self.convert_btn = tk.Button(self.root, text="Convert", command=self.start_conversion, bg="green", fg="white") self.convert_btn.pack(pady=20)
for file in files: input_path = os.path.join(input_dir, file) convert_audio(input_path, output_format, bitrate, output_dir) def main(): parser = argparse.ArgumentParser(description="Jovo Audio Converter") parser.add_argument("input", help="Input file or directory (for batch)") parser.add_argument("output_format", choices=SUPPORTED_FORMATS, help="Target format") parser.add_argument("--bitrate", default="192k", help="Bitrate (e.g., 128k, 320k)") parser.add_argument("--output_dir", help="Output directory (optional)") parser.add_argument("--batch", action="store_true", help="Batch convert all audio in input directory") help="Target format") parser.add_argument("--bitrate"
self.create_widgets()