[Python] Pyttsx3 not saving MP3

Discussão em 'Python' iniciado por Stack, Julho 25, 2025.

  1. Stack

    Stack Membro Participativo

    Here is my code:

    mp3_path = filedialog.asksaveasfile(filetypes=(("MP3 files", "*.mp3"),
    ("All files", "*.*"))) # User prompt to select a path.

    engine = pyttsx3.init() # A pyttsx3 object

    engine.setProperty('rate', 100) # Set speed to speed given in entry

    engine.save_to_file('Hi and welcome to my audiobook.', mp3_path) # Save mp3 to specified path
    engine.runAndWait()


    Now, when I try to save the MP3, it doesn't work and the mp3 is empty. I copied and pasted the doc example but it still doesn't work.

    I am using MacOS so installing espeak-ng is not needed too.

    Continue reading...

Compartilhe esta Página