summaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-09 21:07:18 -0400
committerGitHub <noreply@github.com>2020-09-09 21:07:18 -0400
commit58e5ddfde00eb28ac3a12cd2c83c1088a63d7d23 (patch)
tree7ea4b3c26cec99e22a73b6edcbd17e101a2e4b29 /ext/mixed
parent5d2261acb972374c45fca022f121609405873e90 (diff)
Generalize AnkiNoteBuilder to not use audioSystem directly (#796)
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/audio-system.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mixed/js/audio-system.js b/ext/mixed/js/audio-system.js
index 07e1a79b..9bf12510 100644
--- a/ext/mixed/js/audio-system.js
+++ b/ext/mixed/js/audio-system.js
@@ -185,7 +185,11 @@ class AudioSystem {
throw new Error('Could not retrieve audio');
}
- return arrayBuffer;
+ return this._arrayBufferToBase64(arrayBuffer);
+ }
+
+ _arrayBufferToBase64(arrayBuffer) {
+ return btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)));
}
_isAudioValid(audio) {