-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
824eaeb
commit cdad108
Showing
2 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import requests | ||
from config import API_URL | ||
from config import ONIGIRI_URL, OPENTTS_URL | ||
|
||
def define_en_get(word): | ||
resp = requests.get(f"{API_URL}/define/en/{word}") | ||
resp = requests.get(f"{ONIGIRI_URL}/define/en/{word}") | ||
if resp: | ||
print(resp.json()) | ||
|
||
|
||
# TODO look into pyaudio or sm to play the response audio | ||
|
||
TTS_VOICE = "coqui-tts:en_vctk" | ||
def synthesis_get(text): | ||
# TODO text should be sanitised | ||
resp = requests.get(f"{OPENTTS_URL}/tts?voice={TTS_VOICE}&text={text}") | ||
print(resp) | ||
|
||
if __name__ == "__main__": | ||
define_en_get("hello") | ||
# define_en_get("hello") | ||
synthesis_get("hello world") |
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