diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-06-13 22:09:39 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-06-14 20:44:38 -0700 |
commit | e0f91b9a8a0f2e7db0362ff10623f94c6673d926 (patch) | |
tree | 218f1cefd6737534e7e2abfd911b29205fe663ac /ext/fg/js/client.js | |
parent | 96dd2d45f953e129bbf164d31754493041628014 (diff) |
Elementary audio playback support
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r-- | ext/fg/js/client.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js index ec2ea630..4ac40b65 100644 --- a/ext/fg/js/client.js +++ b/ext/fg/js/client.js @@ -167,6 +167,13 @@ class Client { }); } + api_pronounce(index) { + const dfn = this.definitions[index]; + const url = `http://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kana=${dfn.reading}&kanji=${dfn.expression}`; + const audio = new Audio(url); + audio.play(); + } + api_displayKanji(kanji) { bgFindKanji(kanji, (definitions) => { const sequence = ++this.sequence; |