Clen project.
This commit is contained in:
parent
a998105d03
commit
7826e7b8be
2528
package-lock.json
generated
2528
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "vizualizer",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "ffmpeg -i odcinek1-kuba.wav -ac 1 -filter:a aresample=8000 -map 0:a -c:a pcm_s16le -f data - | hexdump",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^14.0.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"editly": "^0.3.0",
|
|
||||||
"yargs": "^16.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"noImplicitThis": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es6",
|
|
||||||
"allowJs": false,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"outDir": "build"
|
|
||||||
}
|
|
||||||
}
|
|
26
window.ts
26
window.ts
@ -1,26 +0,0 @@
|
|||||||
export default class Window {
|
|
||||||
length: number;
|
|
||||||
buffer: number[] = [];
|
|
||||||
constructor(length: number) {
|
|
||||||
this.length = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
push(element: number) {
|
|
||||||
if (this.buffer.length == this.length) {
|
|
||||||
this.buffer.shift();
|
|
||||||
}
|
|
||||||
this.buffer.push(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
sum() {
|
|
||||||
return this.buffer.reduce((a, b) => a + b, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
clear() {
|
|
||||||
this.buffer = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
isFull() {
|
|
||||||
return this.buffer.length == this.length;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user