accelr8 3.0.4 → 3.0.5
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.
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
VERSION,
|
|
8
8
|
decode,
|
|
9
9
|
encode
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CZENTCH6.js";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_MODEL,
|
|
13
13
|
addAccount,
|
|
@@ -1186,23 +1186,41 @@ var DRAIN_KILL_MS = 2e3;
|
|
|
1186
1186
|
var MAX_PLAYERS = 8;
|
|
1187
1187
|
var STDERR_TAIL = 400;
|
|
1188
1188
|
var VERIFY_MIN_BYTES = SAMPLE_RATE * 2 / 10;
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1189
|
+
function playbackArgs(ffplayPath) {
|
|
1190
|
+
const ch = ffplayChannelFlag(ffplayPath);
|
|
1191
|
+
return [
|
|
1192
|
+
"-hide_banner",
|
|
1193
|
+
"-loglevel",
|
|
1194
|
+
"error",
|
|
1195
|
+
"-nodisp",
|
|
1196
|
+
"-sync",
|
|
1197
|
+
"audio",
|
|
1198
|
+
"-infbuf",
|
|
1199
|
+
"-f",
|
|
1200
|
+
"s16le",
|
|
1201
|
+
"-ar",
|
|
1202
|
+
String(SAMPLE_RATE),
|
|
1203
|
+
...ch,
|
|
1204
|
+
"-i",
|
|
1205
|
+
"-"
|
|
1206
|
+
];
|
|
1207
|
+
}
|
|
1208
|
+
var chFlagCache = null;
|
|
1209
|
+
function ffplayChannelFlag(ffplayPath) {
|
|
1210
|
+
if (chFlagCache) return chFlagCache;
|
|
1211
|
+
let modern = true;
|
|
1212
|
+
try {
|
|
1213
|
+
const out = spawnSync(ffplayPath, ["-hide_banner", "-version"], { encoding: "utf8", timeout: 3e3 });
|
|
1214
|
+
const m = ((out.stdout || "") + (out.stderr || "")).match(/version\s+n?(\d+)\.(\d+)/i);
|
|
1215
|
+
if (m) {
|
|
1216
|
+
const major = +m[1], minor = +m[2];
|
|
1217
|
+
modern = major > 5 || major === 5 && minor >= 1;
|
|
1218
|
+
}
|
|
1219
|
+
} catch {
|
|
1220
|
+
}
|
|
1221
|
+
chFlagCache = modern ? ["-ch_layout", "mono"] : ["-ac", "1"];
|
|
1222
|
+
return chFlagCache;
|
|
1223
|
+
}
|
|
1206
1224
|
function detectVoiceTools() {
|
|
1207
1225
|
const ffmpegPath = which("ffmpeg");
|
|
1208
1226
|
const ffplayPath = which("ffplay");
|
|
@@ -1422,7 +1440,7 @@ var VoicePlayback = class {
|
|
|
1422
1440
|
spawnPlayer(speakerId) {
|
|
1423
1441
|
let child;
|
|
1424
1442
|
try {
|
|
1425
|
-
child = spawn(this.tools.ffplayPath,
|
|
1443
|
+
child = spawn(this.tools.ffplayPath, playbackArgs(this.tools.ffplayPath), { stdio: ["pipe", "ignore", "ignore"] });
|
|
1426
1444
|
} catch {
|
|
1427
1445
|
return null;
|
|
1428
1446
|
}
|
|
@@ -1657,13 +1675,19 @@ var voicePlayback = null;
|
|
|
1657
1675
|
var voiceDevice = process.env.ACCELR8_MIC || void 0;
|
|
1658
1676
|
var voiceRetries = 0;
|
|
1659
1677
|
function autoPickMic() {
|
|
1660
|
-
if (process.platform
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1678
|
+
if (process.platform === "darwin") {
|
|
1679
|
+
const mics = listMicDevices();
|
|
1680
|
+
if (!mics.length) return void 0;
|
|
1681
|
+
const builtin = mics.find((m) => /macbook|built.?in|internal/i.test(m.name));
|
|
1682
|
+
if (builtin) return builtin.index;
|
|
1683
|
+
const notPhone = mics.find((m) => !/iphone|ipad|continuity|desk view/i.test(m.name));
|
|
1684
|
+
return notPhone?.index;
|
|
1685
|
+
}
|
|
1686
|
+
if (process.platform === "win32") {
|
|
1687
|
+
const mics = listMicDevices();
|
|
1688
|
+
return mics[0]?.index;
|
|
1689
|
+
}
|
|
1690
|
+
return void 0;
|
|
1667
1691
|
}
|
|
1668
1692
|
function startCapture() {
|
|
1669
1693
|
if (!voiceCapture) return;
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_SERVER,
|
|
4
4
|
PORT,
|
|
5
5
|
VERSION
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-CZENTCH6.js";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
var HELP = `
|
|
@@ -52,7 +52,7 @@ async function main() {
|
|
|
52
52
|
console.error(`invalid port: ${argVal(args, "--port")}`);
|
|
53
53
|
process.exit(1);
|
|
54
54
|
}
|
|
55
|
-
const { runServer } = await import("./chunks/server-
|
|
55
|
+
const { runServer } = await import("./chunks/server-OGAKQFOU.js");
|
|
56
56
|
runServer(port);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
@@ -76,7 +76,7 @@ async function main() {
|
|
|
76
76
|
const { cachedUpdate, refreshUpdateCache } = await import("./chunks/update-UEPNGB6Y.js");
|
|
77
77
|
refreshUpdateCache();
|
|
78
78
|
const update = cachedUpdate(VERSION);
|
|
79
|
-
const { runClient } = await import("./chunks/client-
|
|
79
|
+
const { runClient } = await import("./chunks/client-DGDZ22XC.js");
|
|
80
80
|
runClient({
|
|
81
81
|
name: argVal(args, "--name"),
|
|
82
82
|
server: argVal(args, "--server"),
|