@beff/aula-cli 0.4.1 → 0.4.2
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/src/{chunk-S54ZVMWJ.js → chunk-6LC3WXJ7.js} +8 -4
- package/dist/src/cli.js +5 -5
- package/dist/src/{commands-CCEO6TTU.js → commands-QCUCX2GF.js} +1 -1
- package/dist/src/{problems-BOX43W3Z.js → problems-7BVC64RO.js} +1 -1
- package/dist/src/{run-GOYOUYXS.js → run-5WC5WRZ2.js} +1 -1
- package/dist/src/{server-PFMYGOU2.js → server-GK3EWFX3.js} +1 -1
- package/dist/web/app/assets/__vite-browser-external-BTgt74Au.js +1 -0
- package/dist/web/app/assets/{aula-voice-worker-B_Xo0vtz.js → aula-voice-worker-CZGtnmSr.js} +10 -10
- package/dist/web/app/assets/dcda3118/aula-method.js +1 -0
- package/dist/web/app/assets/{8c26d0ac → dcda3118}/index.js +1 -1
- package/dist/web/app/index.html +1 -1
- package/package.json +2 -2
- package/dist/web/app/assets/8c26d0ac/aula-method.js +0 -1
- package/dist/web/app/assets/__vite-browser-external-Duv2uQvP.js +0 -1
- /package/dist/web/app/assets/{8c26d0ac → dcda3118}/aula.js +0 -0
- /package/dist/web/app/assets/{8c26d0ac → dcda3118}/build-worker.js +0 -0
|
@@ -305,6 +305,8 @@ var HOP = 300;
|
|
|
305
305
|
var MAX_TOKENS = 250;
|
|
306
306
|
var LEAD = 16;
|
|
307
307
|
var FIRST = 3;
|
|
308
|
+
var TRAIL = 16;
|
|
309
|
+
var SILENT = new Set(';:,.!?\u2014\u2026"()\u201C\u201D ');
|
|
308
310
|
var PEAK = 0.99;
|
|
309
311
|
function limited(audio) {
|
|
310
312
|
let loudest = 0;
|
|
@@ -328,12 +330,14 @@ async function layout(parts, words, audio) {
|
|
|
328
330
|
const edges = [0];
|
|
329
331
|
for (let i = 0; i < spoken.durations.length; i++) edges.push((edges[i] ?? 0) + Number(spoken.durations[i]) * HOP);
|
|
330
332
|
const head = Math.max((edges[1] ?? 0) - LEAD * HOP, 0);
|
|
331
|
-
const tail = edges.at(-2) ?? head;
|
|
332
333
|
const first = Math.max((edges[1] ?? 0) - FIRST * HOP, head);
|
|
334
|
+
const last = known.findLastIndex((phoneme) => !SILENT.has(phoneme));
|
|
335
|
+
const end = edges.at(-2) ?? head;
|
|
336
|
+
const tail = last < 0 ? end : Math.min(end, Math.max((edges[last + 1] ?? end) + TRAIL * HOP, head));
|
|
333
337
|
known.forEach((phoneme, i) => {
|
|
334
|
-
const start = (i === 0 ? first : edges[i] ?? head) - head + offset;
|
|
335
|
-
const
|
|
336
|
-
timings.push({ phoneme, start: start / SAMPLE_RATE, end:
|
|
338
|
+
const start = Math.min(i === 0 ? first : edges[i] ?? head, tail) - head + offset;
|
|
339
|
+
const stop = Math.min(edges[i + 1] ?? tail, tail) - head + offset;
|
|
340
|
+
timings.push({ phoneme, start: start / SAMPLE_RATE, end: stop / SAMPLE_RATE });
|
|
337
341
|
});
|
|
338
342
|
const pause = index < batches.length - 1 ? Math.floor(pauseAfter(batch) * SAMPLE_RATE) : 0;
|
|
339
343
|
pieces.push({ audio: spoken.audio?.subarray(head, tail) ?? null, length: tail - head, pause });
|
package/dist/src/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
studentWeightFile,
|
|
15
15
|
timeAulaVoice,
|
|
16
16
|
tokenBatches
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6LC3WXJ7.js";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
import { spawn } from "node:child_process";
|
|
@@ -271,9 +271,9 @@ var base = Capabilities.create({
|
|
|
271
271
|
},
|
|
272
272
|
spawn
|
|
273
273
|
});
|
|
274
|
-
var { diagnosticsOf, printDiagnostics } = await import("./problems-
|
|
274
|
+
var { diagnosticsOf, printDiagnostics } = await import("./problems-7BVC64RO.js");
|
|
275
275
|
var { host, loadProject } = await import("./project-NWT5MDQI.js");
|
|
276
|
-
var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, webOptions } = await import("./run-
|
|
276
|
+
var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, webOptions } = await import("./run-5WC5WRZ2.js");
|
|
277
277
|
var locks = createLocks(base, path3.join(os.homedir(), ".cache/aula/heavy.lock"));
|
|
278
278
|
var render = createRender(base, process.execPath);
|
|
279
279
|
var models = path3.join(os.homedir(), ".cache/aula/models");
|
|
@@ -296,7 +296,7 @@ async function main(argv) {
|
|
|
296
296
|
}
|
|
297
297
|
const args = parse(rest, optionsOf(command));
|
|
298
298
|
if (command === "web") {
|
|
299
|
-
const { serve } = await import("./server-
|
|
299
|
+
const { serve } = await import("./server-GK3EWFX3.js");
|
|
300
300
|
const stop = new AbortController();
|
|
301
301
|
for (const signal of ["SIGINT", "SIGTERM"]) process.once(signal, () => stop.abort());
|
|
302
302
|
const web = Capabilities.create({
|
|
@@ -312,7 +312,7 @@ async function main(argv) {
|
|
|
312
312
|
return 0;
|
|
313
313
|
}
|
|
314
314
|
if (command === "tokens") {
|
|
315
|
-
const { tokens, tokensArgs } = await import("./commands-
|
|
315
|
+
const { tokens, tokensArgs } = await import("./commands-QCUCX2GF.js");
|
|
316
316
|
tokensArgs(args.positional);
|
|
317
317
|
const tokensOf = createTokens();
|
|
318
318
|
return await tokens(capabilities, tokensOf, createInterface({ input: process.stdin, crlfDelay: Infinity })) ? 0 : 1;
|
|
@@ -12,7 +12,7 @@ import "./chunk-GFCJYE75.js";
|
|
|
12
12
|
import "./chunk-2XGNOG2U.js";
|
|
13
13
|
import "./chunk-BT3Z5CJI.js";
|
|
14
14
|
import "./chunk-S74JLCZK.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-6LC3WXJ7.js";
|
|
16
16
|
import "./chunk-46KT47TH.js";
|
|
17
17
|
import "./chunk-7KT36JRP.js";
|
|
18
18
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./aula-voice-worker-CZGtnmSr.js";var t=/* @__PURE__ */ e(((e,t)=>{t.exports={}}));export default t();
|