Skip to content

Commit

Permalink
Initial real commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasFavarao committed Nov 9, 2024
0 parents commit 3c8cbca
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./TMBrain
./TMBrain.pub
./[email protected]
./todo.txt
13 changes: 13 additions & 0 deletions sendAudio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!bin/bash

num=0
while [ $num -le 4 ]
do
Python tts.py
mp3FileName=tempFile.mp3
scp $mp3FileName [email protected]:/home/TMBrain/Desktop
printf "File has been sent\n"
ssh [email protected] 'mpg123 /home/TMBrain/Desktop/tempFile.mp3;rm /home/TMBrain/Desktop/tempFile.mp3 '
done
rm $mp3FileName

38 changes: 38 additions & 0 deletions tts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from gtts import gTTS

LANGUAGE = "en"

def ttsGenerate(textStr):
ttsObj = gTTS(text = textStr, lang = LANGUAGE, slow= False)
ttsObj.save("tempFile.mp3")

print("Enter Text to Generate")

textToGen = input()

ttsGenerate(textToGen)



"""
text = "Hello world, I am a tts test"
ttsObj = gTTS(text=text,lang = 'en', slow=False)
ttsObj.save("test.mp3")
pygame.mixer.init()
pygame.mixer.music.load("test.mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
time.sleep(1)
pygame.mixer.music.stop()
pygame.mixer.music.unload()
if os.path.exists("test.mp3"):
os.remove("test.mp3")
else:
print("The file doesnt exsit")
"""

0 comments on commit 3c8cbca

Please sign in to comment.