Closed Matadore3 closed 3 years ago
myText = open(r'podcast.txt', 'w')
'charmap' codec can't encode character '\u2015' in position 5700: character maps to
myText = open(r'podcast.txt', 'w', encoding='utf-8')
This fix must be used by all Windows users, otherwise the program will not run properly.
For both Windows and Mac users, it is important to encode the list from the scrapper into Latin-1 so that a pdf can be created.
The following code is used to encode (applies to Mac and Windows):
text_encoded = text.encode('latin-1', 'replace').decode('latin-1')
For both Mac and Windows users, it is important to prepare the output of the scraper as part of the mp3 saving process so that there is a comma after each sentence/entry and not a period. Otherwise the program will save only the first entry for the selected keywords as mp3 format
Code:
text = text.replace(".", ", ")
Both Mac and Windows require different keys regarding the language settings in the code. If the program does not find the respective key, the podcast will be played with the default language. Because of this, we have written a loop that contains both the Windows and Mac language keys.
For Example:
if platform.system() == "Darwin":
engine.setProperty("voice", "com.apple.speech.synthesis.voice.Alex")
else:
engine.setProperty("voice",
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\"
"Tokens\\TTS_MS_EN-US_DAVID_11.0")
In this issue we should list all errors we had while coding with their solutions