mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-06 16:47:59 +08:00
js : decode now returns typed array and cannot be null
If no data is decoded, then the returned array is empty.
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
navigator.mediaDevices.getUserMedia(constraints).then(function (e) {
|
||||
mediaStream = context.createMediaStreamSource(e);
|
||||
|
||||
var bufferSize = 16*1024;
|
||||
var bufferSize = 1024;
|
||||
var numberOfInputChannels = 1;
|
||||
var numberOfOutputChannels = 1;
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
recorder.onaudioprocess = function (e) {
|
||||
var source = e.inputBuffer;
|
||||
var res = ggwave.decode(instance, convertTypedArray(new Float32Array(source.getChannelData(0)), Int8Array));
|
||||
if (res) {
|
||||
if (res && res.length > 0) {
|
||||
rxData.value = res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user