1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Pyttsx3 runs but output no sound

Discussão em 'Python' iniciado por Stack, Setembro 28, 2024 às 09:02.

  1. Stack

    Stack Membro Participativo

    import pyttsx3

    # Initialize the engine
    engine = pyttsx3.init()

    # Adjust speaking rate
    rate = engine.getProperty('rate')
    print(f'Current speaking rate: {rate}')
    engine.setProperty('rate', 125)

    # Adjust volume
    volume = engine.getProperty('volume')
    print(f'Current volume level: {volume}')
    engine.setProperty('volume', 1.0)

    # Change voice
    voices = engine.getProperty('voices')
    engine.setProperty('voice', voices[1].id) # Selecting a female voice

    # Make the engine speak
    engine.say("Hello World!")
    engine.say(f'My current speaking rate is {rate}')

    print("test")
    engine.runAndWait()

    engine.stop()


    I have tried everything. Python and pyttsx3 are in the newest version, the drivers are up-to-date. The code compiles perfectly without errors. But there was just no sound. Is there any configuration I should do before using pyttsx3?

    Continue reading...

Compartilhe esta Página