whspr 1.0.10 → 1.0.12
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/dist/recorder.js +12 -2
- package/package.json +1 -1
package/dist/recorder.js
CHANGED
|
@@ -36,17 +36,27 @@ export async function record(verbose = false) {
|
|
|
36
36
|
let currentDb = -60;
|
|
37
37
|
let cancelled = false;
|
|
38
38
|
// Spawn FFmpeg with ebur128 filter to get volume levels
|
|
39
|
+
// Use asplit to duplicate audio: one copy for analysis (ebur128 -> null), one clean copy to file
|
|
39
40
|
const ffmpeg = spawn("ffmpeg", [
|
|
40
41
|
"-f",
|
|
41
42
|
"avfoundation",
|
|
43
|
+
"-thread_queue_size",
|
|
44
|
+
"1024",
|
|
42
45
|
"-i",
|
|
43
46
|
":0",
|
|
44
|
-
"-
|
|
45
|
-
"ebur128=peak=true",
|
|
47
|
+
"-filter_complex",
|
|
48
|
+
"[0:a]asplit=2[meter][out];[meter]ebur128=peak=true[null]",
|
|
49
|
+
"-map",
|
|
50
|
+
"[out]",
|
|
46
51
|
"-t",
|
|
47
52
|
MAX_DURATION_SECONDS.toString(),
|
|
48
53
|
"-y",
|
|
49
54
|
wavPath,
|
|
55
|
+
"-map",
|
|
56
|
+
"[null]",
|
|
57
|
+
"-f",
|
|
58
|
+
"null",
|
|
59
|
+
"-",
|
|
50
60
|
], {
|
|
51
61
|
stdio: ["pipe", "pipe", "pipe"],
|
|
52
62
|
});
|