Skip to content

Commit 0b825ed

Browse files
committed
flake8 linting
1 parent edfd454 commit 0b825ed

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

auto_news_reader/mySpeaker.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Import the platform module to identify your OS
22
import platform
3+
34
# If you are using Windows, use pyttsx3 for text to speech
45
if platform.system() == "Windows":
56
import pyttsx3
7+
68
try:
79
engine = pyttsx3.init()
810
except ImportError:
@@ -19,11 +21,12 @@ def print_say(txt):
1921
engine.say(txt)
2022
engine.runAndWait()
2123
# If you are using Mac or Linux, use gtts for text to speech
22-
if platform.system() == "Darwin" or platform.system() == "Linux":
24+
elif platform.system() == "Darwin" or platform.system() == "Linux":
2325
import os
2426

2527
def print_say(texts):
2628
print(texts)
27-
texts = texts.replace('"','')
28-
texts = texts.replace("'","")
29-
os.system(f'gtts-cli --nocheck "{texts}" | mpg123 -q -')
29+
texts = texts.replace('"', '')
30+
texts = texts.replace("'", "")
31+
os.system(f'gtts-cli --nocheck "{texts}" | mpg123 -q -')
32+
# End of File

auto_news_reader/voice_to_text.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import speech_recognition as sr
2+
23
speech = sr.Recognizer()
34

45

@@ -15,4 +16,5 @@ def voice_to_text():
1516
pass
1617
except sr.WaitTimeoutError:
1718
pass
18-
return voice_input
19+
return voice_input
20+
# End of File.

0 commit comments

Comments
 (0)