Created
November 19, 2019 15:30
-
-
Save tejasvi/c11e7268b7148d1014d3f19ed12c1588 to your computer and use it in GitHub Desktop.
Retrieve Ame pronunciation of words offered by google
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
import urllib.request | |
import shutil | |
... | |
# Download the file from `url` and save it locally under `file_name`: | |
with urllib.request.urlopen(url) as response, open(file_name, 'wb') as out_file: | |
shutil.copyfileobj(response, out_file) | |
word = "blah" | |
url = f"https://ssl.gstatic.com/dictionary/static/pronunciation/2019-10-21/audio/{word[:2]}/{word}_en_us_3.mp3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment