ergosumdre commited on
Commit
621208b
·
1 Parent(s): 5e88240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -27,16 +27,12 @@ except (BotoCoreError, ClientError) as error:
27
  print('Error: ', error)
28
 
29
  def speak_text(text):
30
- engine = pyttsx3.init()
31
- try:
32
- engine.endLoop()
33
- del engine
34
- engine = pyttsx3.init()
35
- except:
36
- pass
37
- engine.startLoop()
38
- engine.setProperty('rate', 185)
39
- engine.say(text)
40
 
41
 
42
 
 
27
  print('Error: ', error)
28
 
29
  def speak_text(text):
30
+ # Specify the text to be converted to speech
31
+ text = "Hello, this is an example of using the built-in `espeak-ng` command for text-to-speech conversion on Linux."
32
+
33
+ # Use the `espeak-ng` command to convert the text to speech and play it
34
+ os.system(f"espeak-ng '{text}'")
35
+
 
 
 
 
36
 
37
 
38