Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 54cfc57

Browse files
committed
Update
1 parent 53553ba commit 54cfc57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎Imagetospeech/image_to_speech.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
target = Image.open(img)
1111
text = pytesseract.image_to_string(target, config='')
1212

13-
with open(f"./Imagetospeech/Text/text.txt",'w') as f:
13+
with open(f"./Imagetospeech/text.txt",'w') as f:
1414
f.write(text)
1515

16-
file = open(r'./Imagetospeech/Text/text.txt')
16+
file = open(r'./Imagetospeech/text.txt')
1717
mytext = file.read().replace("\n"," ")
1818
language = 'en'
1919
output = gTTS(text=mytext, lang=language, slow=False)
20-
output.save('./Imagetospeech/sound/imagetospeech.mp3')
20+
output.save('./Imagetospeech/imagetospeech.mp3')
2121
file.close()
22-
os.system("start ./Imagetospeech/sound/imagetospeech.mp3")
22+
os.system("start ./Imagetospeech/imagetospeech.mp3")
2323

2424
question = input("Do you want to delete the files (Y/N): ")
2525
if question=='Y'or question=='y':
26-
os.remove('./Imagetospeech/Text/text.txt')
27-
os.remove('./Imagetospeech/sound/imagetospeech.mp3')
26+
os.remove('./Imagetospeech/text.txt')
27+
os.remove('./Imagetospeech/imagetospeech.mp3')
2828

2929
elif question=='N'or question=='n':
3030
print("Files saved")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /