Last active
March 16, 2021 01:28
-
-
Save jacks0n9/c8e0dab01099fb23a136b5e3a2c9fd0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import quote | |
from urllib.request import urlopen | |
text=input("Input text you want to synthesize: ") | |
filename=input("What file should I put the audio in: ") | |
url="https://www.google.com/speech-api/v1/synthesize?lang=en&text="+quote(text) | |
data=urlopen(url) | |
audio=data.read() | |
with open(filename,'wb') as file: | |
file.write(audio) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment