tone-stream 1.11.2 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -10
- package/package.json +4 -3
package/index.js
CHANGED
|
@@ -27,14 +27,11 @@ class ToneStream extends Readable {
|
|
|
27
27
|
|
|
28
28
|
this.currentSample = 0;
|
|
29
29
|
|
|
30
|
-
this.pending_ended = false;
|
|
31
|
-
|
|
32
30
|
this.eventEmitter = new EventEmitter();
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
add(spec) {
|
|
36
34
|
this.specReadStream.add(spec);
|
|
37
|
-
this.pending_ended = true
|
|
38
35
|
var num_samples = spec[0]
|
|
39
36
|
return num_samples
|
|
40
37
|
}
|
|
@@ -45,7 +42,6 @@ class ToneStream extends Readable {
|
|
|
45
42
|
this.specReadStream.add(spec);
|
|
46
43
|
num_samples += spec[0]
|
|
47
44
|
});
|
|
48
|
-
this.pending_ended = true
|
|
49
45
|
return num_samples
|
|
50
46
|
}
|
|
51
47
|
|
|
@@ -54,7 +50,7 @@ class ToneStream extends Readable {
|
|
|
54
50
|
|
|
55
51
|
if (evt == "empty") {
|
|
56
52
|
this.specReadStream.on(evt, cb);
|
|
57
|
-
} else
|
|
53
|
+
} else {
|
|
58
54
|
this.eventEmitter.on(evt, cb);
|
|
59
55
|
}
|
|
60
56
|
}
|
|
@@ -79,17 +75,15 @@ class ToneStream extends Readable {
|
|
|
79
75
|
var buf_idx = 0;
|
|
80
76
|
|
|
81
77
|
if (!specs) {
|
|
82
|
-
|
|
83
|
-
this.pending_ended = false
|
|
84
|
-
this.eventEmitter.emit("ended")
|
|
85
|
-
}
|
|
86
|
-
|
|
78
|
+
/*
|
|
87
79
|
for (var j = 0; j < numSamples * this.channels; j++) {
|
|
88
80
|
let offset = j * sampleSize * this.channels;
|
|
89
81
|
setter(0, offset);
|
|
90
82
|
}
|
|
91
83
|
|
|
92
84
|
this.push(buf);
|
|
85
|
+
*/
|
|
86
|
+
this.push(null)
|
|
93
87
|
return;
|
|
94
88
|
}
|
|
95
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tone-stream",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "A simple audio tone stream library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"author": "MayamaTakeshi",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@mayama/audio-utils": "^1.2.0",
|
|
25
|
+
"dtmf-detection-stream": "^1.16.2",
|
|
24
26
|
"lodash": "^4.17.21",
|
|
25
27
|
"speaker": "^0.5.1",
|
|
26
|
-
"wav": "^1.0.2"
|
|
27
|
-
"dtmf-detection-stream": "^1.10.0"
|
|
28
|
+
"wav": "^1.0.2"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"morse-node": "^0.1.1",
|