Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fredericomattos opened this issue Jul 25, 2022 · 1 comment

Comments

@fredericomattos
Copy link

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.

@willwade
Copy link
Collaborator

For this you would need save to file method or our upcoming #333 PR #333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants