mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-07 01:11:22 +08:00
js : fix test and example
This commit is contained in:
@@ -137,7 +137,9 @@
|
||||
recorder.onaudioprocess = function (e) {
|
||||
var source = e.inputBuffer;
|
||||
var res = ggwave.decode(instance, convertTypedArray(new Float32Array(source.getChannelData(0)), Int8Array));
|
||||
|
||||
if (res && res.length > 0) {
|
||||
res = new TextDecoder("utf-8").decode(res);
|
||||
rxData.value = res;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ factory().then(function(ggwave) {
|
||||
// decode the audio waveform back to text
|
||||
var res = ggwave.decode(instance, waveform);
|
||||
|
||||
if (res != payload) {
|
||||
if (new TextDecoder("utf-8").decode(res) != payload) {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user