linux – Python Text-To-Speech Logic making weird pronunciations
When I used windows this code ran perfectly. It has been 2 weeks since I switched to fedora. I am not sure what is making it behave like so.
import pyttsx3
from colorama import Fore, Style
#Setting up Rate
RATE = 175
engine = pyttsx3.init()
engine.setProperty('rate',RATE)
#Volume
VOLUME = 0.85 #Must be between 0 to 1. A float too.
engine.setProperty('volume',VOLUME)
#Voice ID
engine.setProperty('voice',engine.getProperty('voices')[0].id) #id 1 for female, 0 for male
def Speak(speech):
print(Fore.LIGHTMAGENTA_EX+speech+Style.RESET_ALL)
engine.say(speech)
engine.runAndWait()
return
This is output of my Small Language Model.
ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
You are requested to wait for a while
Listening Now
It pronounced yo ar requested to wait for a while
With the female voice it pronounces more worse.
yo r reqsted to wait for a wee le
This sounds very glitching. I am not sure what to do now and asking for help.
I will like to say I don’t have pulseaudio but have espeak which is used by pythonttsx3
I found a similar issue on Ubuntu Forum but JACK is already good here. Also it broke my system components.
Last metadata expiration check: 3:13:25 ago on Thu 01 Aug 2024 12:29:13 PM +06.
Error:
Problem: problem with installed package pipewire-jack-audio-connection-kit-1.0.7-2.fc40.x86_64
- package pipewire-jack-audio-connection-kit-1.0.7-2.fc40.x86_64 from @System conflicts with jack-audio-connection-kit-dbus provided by jack-audio-connection-kit-dbus-1.9.22-5.fc40.x86_64 from fedora
- package pipewire-jack-audio-connection-kit-1.0.4-2.fc40.x86_64 from fedora conflicts with jack-audio-connection-kit-dbus provided by jack-audio-connection-kit-dbus-1.9.22-5.fc40.x86_64 from fedora
- package pipewire-jack-audio-connection-kit-1.0.7-2.fc40.x86_64 from updates conflicts with jack-audio-connection-kit-dbus provided by jack-audio-connection-kit-dbus-1.9.22-5.fc40.x86_64 from fedora
- conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
Many people say to remove ALSA configurations but that moves the log but never fixed the issue.
Read more here: Source link