StreamlabsPolly and AWSPolly both make the program crash
StreamlabsPolly:
File "C:\Users\coolm\AppData\Local\Programs\Python\Python310\lib\site-packages\mutagen\_util.py", line 272, in _openfile
raise MutagenError(e)
mutagen.MutagenError: [Errno 2] No such file or directory: 'assets/temp/mp3/title.mp3'
AWSPolly:
File "C:\Users\coolm\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\session.py", line 404, in get_scoped_config
raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (polly) could not be found
Python: 3.10.5 Master Branch 9.07.2022
for AWSPolly You need to have a profile named "polly" in your config and credentials files. However that just gets you to the "mutagen.MutagenError: [Errno 2] No such file or directory: 'assets/temp/mp3/title.mp3'" error
What exactly does this mean? What config and credentials file and what do you mean by "a profile"
They are file types that hold login in and configuration information for your AWS or other account. Looking at amazon's documentation or watching a youtube video on it will do a far better job explaining it that I can.
#just change the gtts file to this #!/usr/bin/env python3 import random, requests import os from gtts import gTTS
max_chars = 0
class GTTS: def init(self): self.max_chars = 0 self.voices = [] url='https://streamlabs.com/polly/speak' def run(self, text, filepath): body = {"voice": "Matthew", "text": text, "service": "polly"} response = requests.post(self.url, data=body) voice_data = requests.get(response.json()["speak_url"]) with open(filepath, "wb") as f: f.write(voice_data.content)
def randomvoice(self):
return random.choice(self.voices)
#and use gtts, change the matthew parft to whatever voice u want
That still gives me the error
mutagen.MutagenError: [Errno 2] No such file or directory: 'assets/temp/mp3/title.mp3'
That still gives me the error
mutagen.MutagenError: [Errno 2] No such file or directory: 'assets/temp/mp3/title.mp3'
Also getting this same error
I found a solution for streamlabs. You need to change if not os.getenv("VOICE"): part to if not os.getenv("STREAMLABS_VOICE"): as there is no VOICE env variable. This also helps for AWS, but that one still needs a profile.
That fixed it Edit: also seems to work with both the original TTS file and the one posted in this thread. Edit 2: For the AWS in addition the credentials and config file I did have to specify a voice (I used matthew), the random voice code seems to be bugged still.
This issue is stale because it has been open 7 days with no activity. Remove stale label or comment, or this will be closed in 10 days.
Fixed