@beff/aula-cli 0.4.1 → 0.4.3

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/README.md CHANGED
@@ -8,4 +8,4 @@ The package has no model file. The first command that narrates or times a video
8
8
 
9
9
  ## Licenses
10
10
 
11
- aula's own code is MIT; the engine includes eSpeak NG, GPL-3.0-or-later, so the package as a whole is MIT AND GPL-3.0-or-later. The engine component also has third-party code and data, with their own licenses, in `dist/licenses/`: eSpeak NG (GPL-3.0-or-later), misaki (Apache-2.0), spaCy (MIT) and the fonts Nunito Sans and JetBrains Mono (SIL Open Font License 1.1).
11
+ aula's own code is MIT; the engine includes eSpeak NG, GPL-3.0-or-later, so the package as a whole is MIT AND GPL-3.0-or-later. The engine component also has third-party code and data, with their own licenses, in `dist/licenses/`: eSpeak NG (GPL-3.0-or-later), misaki (Apache-2.0), spaCy (MIT) and the fonts Nunito Sans, JetBrains Mono and Noto Sans (SIL Open Font License 1.1).
@@ -0,0 +1,94 @@
1
+ Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
2
+ Copyright 2016 Google LLC. All Rights Reserved. (Noto Sans Symbols: the arrows)
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ https://openfontlicense.org
7
+
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font creation
16
+ efforts of academic and linguistic communities, and to provide a free and
17
+ open framework in which fonts may be shared and improved in partnership
18
+ with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply
27
+ to any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software components as
38
+ distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to, deleting,
41
+ or substituting -- in part or in whole -- any of the components of the
42
+ Original Version, by changing formats or by porting the Font Software to a
43
+ new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+ redistribute, and sell modified and unmodified copies of the Font
52
+ Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components,
55
+ in Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the corresponding
66
+ Copyright Holder. This restriction only applies to the primary font name as
67
+ presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created
79
+ using the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -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 end = (edges[i + 1] ?? tail) - head + offset;
336
- timings.push({ phoneme, start: start / SAMPLE_RATE, end: end / SAMPLE_RATE });
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-S54ZVMWJ.js";
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-BOX43W3Z.js");
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-GOYOUYXS.js");
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-PFMYGOU2.js");
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-CCEO6TTU.js");
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-S54ZVMWJ.js";
15
+ import "./chunk-6LC3WXJ7.js";
16
16
  import "./chunk-46KT47TH.js";
17
17
  import "./chunk-7KT36JRP.js";
18
18
  export {
@@ -2,7 +2,7 @@ import {
2
2
  printDiagnostics
3
3
  } from "./chunk-BT3Z5CJI.js";
4
4
  import "./chunk-S74JLCZK.js";
5
- import "./chunk-S54ZVMWJ.js";
5
+ import "./chunk-6LC3WXJ7.js";
6
6
  import {
7
7
  diagnosticsOf
8
8
  } from "./chunk-7KT36JRP.js";
@@ -10,7 +10,7 @@ import "./chunk-GFCJYE75.js";
10
10
  import "./chunk-2XGNOG2U.js";
11
11
  import "./chunk-BT3Z5CJI.js";
12
12
  import "./chunk-S74JLCZK.js";
13
- import "./chunk-S54ZVMWJ.js";
13
+ import "./chunk-6LC3WXJ7.js";
14
14
  import "./chunk-46KT47TH.js";
15
15
  import {
16
16
  wrongArgument
@@ -1,7 +1,7 @@
1
1
  import "./chunk-S74JLCZK.js";
2
2
  import {
3
3
  SERVER_WEIGHTS_PATH
4
- } from "./chunk-S54ZVMWJ.js";
4
+ } from "./chunk-6LC3WXJ7.js";
5
5
  import {
6
6
  exists
7
7
  } from "./chunk-46KT47TH.js";
@@ -0,0 +1 @@
1
+ import{t as e}from"./aula-voice-worker-D9iPLcHQ.js";var t=/* @__PURE__ */ e(((e,t)=>{t.exports={}}));export default t();