mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-06 11:05:26 +00:00
Merge pull request #39 from aguspiza/fix_linux_text_to_speech
linux text to speech
This commit is contained in:
commit
dd91a802f8
@ -12,6 +12,6 @@ pip3 install -r requirements.txt
|
||||
pip3 install selenium
|
||||
|
||||
# Install portaudio for pyAudio
|
||||
sudo apt-get install -y portaudio19-dev python3-dev
|
||||
sudo apt-get install -y portaudio19-dev python3-dev alsa-utils
|
||||
|
||||
echo "Installation complete for Linux!"
|
@ -42,11 +42,13 @@ class Speech():
|
||||
audio_file = 'sample.wav'
|
||||
display(Audio(data=audio, rate=24000, autoplay=i==0), display_id=False)
|
||||
sf.write(audio_file, audio, 24000) # save each audio file
|
||||
if platform.system().lower() != "windows":
|
||||
subprocess.call(["afplay", audio_file])
|
||||
else:
|
||||
if platform.system().lower() == "windows":
|
||||
import winsound
|
||||
winsound.PlaySound(audio_file, winsound.SND_FILENAME)
|
||||
elif platform.system().lower() == "linux":
|
||||
subprocess.call(["aplay", audio_file])
|
||||
else:
|
||||
subprocess.call(["afplay", audio_file])
|
||||
|
||||
def replace_url(self, url: re.Match) -> str:
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user