From e0f91b9a8a0f2e7db0362ff10623f94c6673d926 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 13 Jun 2016 22:09:39 -0700 Subject: Elementary audio playback support --- ext/fg/js/client.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/fg/js/client.js') 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; -- cgit v1.2.3