Skip to content

How to use the audio created by pyttsx3 in the microphone output or choose audio output driver? #239

@fredericomattos

Description

@fredericomattos

Usage need:

I'm going to do a draw during an audio conference, for that I'm generating a random number in Python and making pyttsx3 read the text created.

from num2words import num2words
from random import randint
import pyttsx3

engine = pyttsx3.init()
engine.setProperty('voice','HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\MSTTS_V110_ptBR_DanielM')

text = num2words(randint(1,10), lang='pt_BR')
engine.say(text=f'The number drawn was {text}')
engine.runAndWait()

But this speech is coming out of my speaker, I would like this speech to come out as my microphone, so that people who are in the conference call hear the result of the draw as if I were speaking.

If Visual Studio Code or Python appears in the Windows sound apps list, I could set the output to CABLE Input and use it as a microphone on my digital soundboard as I did with Google Chrome:

enter image description here

But as they do not appear, I would like to know if there is any way to select which audio output driver pyttsx3 will use or if there is some other module that can work with it to make this choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions