python will convert text speech to audio data

I think what you need is – Realtime_PyAudio_FFT

One of the benefits of this is that

Starts a stream_reader that pulls live audio data from any source using PyAudio (soundcard, microphone, …)

Since you’ll be playing the audio using pyttsx3 it can extract the audio from the soundcard and would show a live visualization. This is a far better option for your case instead of extracting it via the microphone.

Also, you may need to enable threading or multiprocessing to visualize the audio if it’s being executed by the same thread. Here’s a good guide on that – threading or multiprocessing

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top