Comparing version 0.0.0 to 1.0.0
@@ -10,3 +10,3 @@ "use strict" | ||
max_data_size = max_data_size || frame_size | ||
var buffer = new Float32Array(frame_size + max_data_size) | ||
var buffer = new Float32Array(2*frame_size + max_data_size) | ||
var ptr = 0 | ||
@@ -13,0 +13,0 @@ var frame_slices = [] |
{ | ||
"name": "frame-hop", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "Frame slicing for windowed signal processing", | ||
@@ -9,4 +9,3 @@ "main": "hop.js", | ||
}, | ||
"dependencies": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -13,0 +12,0 @@ "tape": "~1.0.4" |
@@ -5,3 +5,3 @@ "use strict" | ||
require("tape")("frame-hop", function(t) { | ||
require("tape")("frame-hop unaligned", function(t) { | ||
@@ -32,3 +32,44 @@ var expected_frames = [ | ||
pushData([14,15,16,17,18,19,20,21]) | ||
t.equals(expected_frames.length, 0) | ||
t.end() | ||
}) | ||
require("tape")("frame-hop aligned", function(t) { | ||
var expected_frames = [ | ||
[0,1,2,3], | ||
[2,3,4,5], | ||
[4,5,6,7], | ||
[6,7,8,9], | ||
[8,9,10,11], | ||
[10,11,12,13], | ||
[12,13,14,15], | ||
[14,15,16,17], | ||
[16,17,18,19], | ||
[18,19,20,21] | ||
] | ||
var slicer = frameHop(4, 2, function(x) { | ||
var f = expected_frames[0] | ||
expected_frames.shift() | ||
t.same(f, Array.prototype.slice.call(x, 0)) | ||
}, 8) | ||
function pushData(arr) { | ||
slicer(new Float32Array(arr)) | ||
} | ||
pushData([0,1,2]) | ||
pushData([3,4]) | ||
pushData([5,6,7,8,9,10,11]) | ||
pushData([12,13]) | ||
pushData([14,15,16,17,18,19,20,21]) | ||
t.equals(expected_frames.length, 0) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5322
92
1