Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
CursedPrograms committed Feb 12, 2024
1 parent 4e211f9 commit 3fc7570
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Empty file removed __init__
Empty file.
10 changes: 6 additions & 4 deletions scripts/gpt/system/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
from gtts import gTTS
import speech_recognition as sr
from .clean_text import clean_text
import sys
sys.path.append(".")
from ...play_audio import play_audio

def text_to_speech(text):
cleaned_text = clean_text(text)
Expand All @@ -15,4 +12,9 @@ def text_to_speech(text):
os.makedirs(os.path.dirname(audio_path), exist_ok=True)

tts.save(audio_path)
play_audio(audio_path)

# Open the audio file with the default media player
try:
subprocess.run(["start", audio_path], check=True, shell=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
1 change: 1 addition & 0 deletions scripts/gpt/transformer_t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from system.generate_text import generate_text
from system.tts import text_to_speech


transformers.logging.set_verbosity_error()
tf.get_logger().setLevel(logging.ERROR)

Expand Down
4 changes: 2 additions & 2 deletions scripts/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import speech_recognition as sr
import wave
from play_audio import play_audio
from ..scripts.gpt.system.generate_text import generate_text
from ..scripts.gpt.system.clean_text import clean_text
from gpt.system.generate_text import generate_text
from gpt.system.clean_text import clean_text
import sys

transformers.logging.set_verbosity_error()
Expand Down

0 comments on commit 3fc7570

Please sign in to comment.