RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

StreamlabsPolly and AWSPolly both make the program crash

Open DustEyezz opened this issue 4 years ago • 10 comments

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

DustEyezz avatar Jul 09 '22 02:07 DustEyezz

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

16aces avatar Jul 09 '22 03:07 16aces

What exactly does this mean? What config and credentials file and what do you mean by "a profile"

notcreeperdude avatar Jul 09 '22 23:07 notcreeperdude

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.

16aces avatar Jul 10 '22 01:07 16aces

#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

Jacobbe08 avatar Jul 10 '22 20:07 Jacobbe08

That still gives me the error

mutagen.MutagenError: [Errno 2] No such file or directory: 'assets/temp/mp3/title.mp3'

16aces avatar Jul 11 '22 02:07 16aces

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

notcreeperdude avatar Jul 11 '22 03:07 notcreeperdude

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.

MantasDemenius avatar Jul 11 '22 15:07 MantasDemenius

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.

16aces avatar Jul 11 '22 16:07 16aces

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.

github-actions[bot] avatar Jul 18 '22 02:07 github-actions[bot]

Fixed

JasonLovesDoggo avatar Jul 19 '22 18:07 JasonLovesDoggo