canvas-recorder-lib 0.7.0 → 0.7.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/README.md +38 -8
- package/dev/audio-builder.ts +5 -1
- package/dev/canvas-recorder.css +15 -4
- package/dev/canvas-recorder.ts +276 -88
- package/dev/delay-files.ts +1 -1
- package/dev/format-editor.ts +7 -2
- package/dev/fourier-panel.ts +11 -3
- package/dev/handwriting-panel.ts +14 -9
- package/dev/local-file-row.ts +12 -5
- package/dev/multi-text-dialog.ts +15 -6
- package/dev/multi-text-panel.ts +6 -2
- package/dev/player-body.ts +4 -0
- package/dev/schedule-helpers.ts +11 -4
- package/dev/sound-clips.ts +4 -1
- package/dev/soundtrack.ts +52 -13
- package/dev/split-dialog.ts +49 -19
- package/dev/static-image-panel.ts +17 -5
- package/dev/synced-file.ts +4 -5
- package/dev/timeline-display.ts +152 -50
- package/dev/transcribe-core.ts +48 -17
- package/dev/transcribe-worker.ts +20 -9
- package/dev/transcript-align.ts +95 -20
- package/dev/transcript-export.ts +18 -7
- package/dev/transcript-view.ts +78 -22
- package/dev/transcripts.ts +97 -26
- package/dev/video-clip-panel.ts +64 -18
- package/dev/voice/chirp.ts +21 -5
- package/dev/voice/folder.ts +22 -7
- package/dev/voice/voice-panel.ts +61 -27
- package/dev/voice/voice-recorder.ts +74 -18
- package/dist/dev/audio-builder.js.map +1 -1
- package/dist/dev/canvas-recorder.css +15 -4
- package/dist/dev/canvas-recorder.js +185 -48
- package/dist/dev/canvas-recorder.js.map +1 -1
- package/dist/dev/format-editor.d.ts.map +1 -1
- package/dist/dev/format-editor.js.map +1 -1
- package/dist/dev/fourier-panel.d.ts.map +1 -1
- package/dist/dev/fourier-panel.js.map +1 -1
- package/dist/dev/handwriting-panel.d.ts.map +1 -1
- package/dist/dev/handwriting-panel.js +10 -8
- package/dist/dev/handwriting-panel.js.map +1 -1
- package/dist/dev/local-file-row.d.ts.map +1 -1
- package/dist/dev/local-file-row.js +12 -4
- package/dist/dev/local-file-row.js.map +1 -1
- package/dist/dev/multi-text-dialog.d.ts.map +1 -1
- package/dist/dev/multi-text-dialog.js +4 -2
- package/dist/dev/multi-text-dialog.js.map +1 -1
- package/dist/dev/multi-text-panel.d.ts.map +1 -1
- package/dist/dev/multi-text-panel.js +2 -1
- package/dist/dev/multi-text-panel.js.map +1 -1
- package/dist/dev/player-body.d.ts +1 -1
- package/dist/dev/player-body.d.ts.map +1 -1
- package/dist/dev/player-body.js +4 -0
- package/dist/dev/player-body.js.map +1 -1
- package/dist/dev/schedule-helpers.d.ts.map +1 -1
- package/dist/dev/schedule-helpers.js +4 -1
- package/dist/dev/schedule-helpers.js.map +1 -1
- package/dist/dev/sound-clips.d.ts.map +1 -1
- package/dist/dev/sound-clips.js.map +1 -1
- package/dist/dev/soundtrack.d.ts +12 -0
- package/dist/dev/soundtrack.d.ts.map +1 -1
- package/dist/dev/soundtrack.js +42 -9
- package/dist/dev/soundtrack.js.map +1 -1
- package/dist/dev/split-dialog.d.ts.map +1 -1
- package/dist/dev/split-dialog.js +17 -10
- package/dist/dev/split-dialog.js.map +1 -1
- package/dist/dev/static-image-panel.d.ts.map +1 -1
- package/dist/dev/static-image-panel.js +7 -3
- package/dist/dev/static-image-panel.js.map +1 -1
- package/dist/dev/synced-file.d.ts.map +1 -1
- package/dist/dev/synced-file.js.map +1 -1
- package/dist/dev/timeline-display.d.ts.map +1 -1
- package/dist/dev/timeline-display.js +62 -17
- package/dist/dev/timeline-display.js.map +1 -1
- package/dist/dev/transcribe-core.d.ts.map +1 -1
- package/dist/dev/transcribe-core.js +13 -3
- package/dist/dev/transcribe-core.js.map +1 -1
- package/dist/dev/transcribe-worker.d.ts.map +1 -1
- package/dist/dev/transcribe-worker.js +9 -3
- package/dist/dev/transcribe-worker.js.map +1 -1
- package/dist/dev/transcript-align.d.ts.map +1 -1
- package/dist/dev/transcript-align.js +52 -9
- package/dist/dev/transcript-align.js.map +1 -1
- package/dist/dev/transcript-export.d.ts.map +1 -1
- package/dist/dev/transcript-export.js +10 -4
- package/dist/dev/transcript-export.js.map +1 -1
- package/dist/dev/transcript-view.d.ts +2 -0
- package/dist/dev/transcript-view.d.ts.map +1 -1
- package/dist/dev/transcript-view.js +32 -11
- package/dist/dev/transcript-view.js.map +1 -1
- package/dist/dev/transcripts.d.ts +5 -0
- package/dist/dev/transcripts.d.ts.map +1 -1
- package/dist/dev/transcripts.js +54 -6
- package/dist/dev/transcripts.js.map +1 -1
- package/dist/dev/video-clip-panel.d.ts.map +1 -1
- package/dist/dev/video-clip-panel.js +25 -8
- package/dist/dev/video-clip-panel.js.map +1 -1
- package/dist/dev/voice/chirp.d.ts.map +1 -1
- package/dist/dev/voice/chirp.js +5 -1
- package/dist/dev/voice/chirp.js.map +1 -1
- package/dist/dev/voice/folder.d.ts.map +1 -1
- package/dist/dev/voice/folder.js +1 -1
- package/dist/dev/voice/folder.js.map +1 -1
- package/dist/dev/voice/voice-panel.d.ts.map +1 -1
- package/dist/dev/voice/voice-panel.js +42 -23
- package/dist/dev/voice/voice-panel.js.map +1 -1
- package/dist/dev/voice/voice-recorder.d.ts.map +1 -1
- package/dist/dev/voice/voice-recorder.js +34 -9
- package/dist/dev/voice/voice-recorder.js.map +1 -1
- package/dist/lib/main-control.d.ts.map +1 -1
- package/dist/lib/main-control.js.map +1 -1
- package/dist/src/corner-rounder.d.ts.map +1 -1
- package/dist/src/corner-rounder.js +1 -1
- package/dist/src/corner-rounder.js.map +1 -1
- package/dist/src/local-files.d.ts.map +1 -1
- package/dist/src/local-files.js +5 -2
- package/dist/src/local-files.js.map +1 -1
- package/dist/src/peano-fourier/fourier-shared.d.ts +7 -0
- package/dist/src/peano-fourier/fourier-shared.d.ts.map +1 -1
- package/dist/src/peano-fourier/fourier-shared.js +8 -1
- package/dist/src/peano-fourier/fourier-shared.js.map +1 -1
- package/dist/src/slide-components/fourier.d.ts.map +1 -1
- package/dist/src/slide-components/fourier.js +12 -4
- package/dist/src/slide-components/fourier.js.map +1 -1
- package/dist/src/slide-components/image.d.ts.map +1 -1
- package/dist/src/slide-components/image.js +1 -1
- package/dist/src/slide-components/image.js.map +1 -1
- package/dist/src/slide-components/in-parallel.d.ts.map +1 -1
- package/dist/src/slide-components/in-parallel.js.map +1 -1
- package/dist/src/slide-components/multi-text.d.ts.map +1 -1
- package/dist/src/slide-components/multi-text.js +1 -1
- package/dist/src/slide-components/multi-text.js.map +1 -1
- package/dist/src/slide-components/rectangle.d.ts.map +1 -1
- package/dist/src/slide-components/rectangle.js +1 -1
- package/dist/src/slide-components/rectangle.js.map +1 -1
- package/dist/src/slide-components/registry.js.map +1 -1
- package/dist/src/slide-components/serialize.d.ts.map +1 -1
- package/dist/src/slide-components/serialize.js +2 -1
- package/dist/src/slide-components/serialize.js.map +1 -1
- package/dist/src/slide-components/split-video-clip.d.ts.map +1 -1
- package/dist/src/slide-components/split-video-clip.js +4 -1
- package/dist/src/slide-components/split-video-clip.js.map +1 -1
- package/dist/src/slide-components/video-clip.d.ts.map +1 -1
- package/dist/src/slide-components/video-clip.js +7 -4
- package/dist/src/slide-components/video-clip.js.map +1 -1
- package/dist/src/slide-components/video-info.d.ts.map +1 -1
- package/dist/src/slide-components/video-info.js.map +1 -1
- package/dist/src/slow-image-sources.d.ts.map +1 -1
- package/dist/src/slow-image-sources.js +1 -1
- package/dist/src/slow-image-sources.js.map +1 -1
- package/dist/src/snapshot.d.ts.map +1 -1
- package/dist/src/snapshot.js +1 -1
- package/dist/src/snapshot.js.map +1 -1
- package/dist/src/utility.d.ts.map +1 -1
- package/dist/src/utility.js +1 -3
- package/dist/src/utility.js.map +1 -1
- package/lib/main-control.ts +3 -1
- package/package.json +4 -1
- package/src/corner-rounder.ts +5 -12
- package/src/glib/letters-base.ts +1 -1
- package/src/local-files.ts +19 -6
- package/src/peano-fourier/fourier-shared.ts +8 -1
- package/src/slide-components/fourier.ts +32 -10
- package/src/slide-components/image.ts +4 -1
- package/src/slide-components/in-parallel.ts +1 -2
- package/src/slide-components/multi-text.ts +17 -4
- package/src/slide-components/rectangle.ts +4 -1
- package/src/slide-components/registry.ts +1 -1
- package/src/slide-components/serialize.ts +4 -1
- package/src/slide-components/split-video-clip.ts +4 -1
- package/src/slide-components/video-clip.ts +21 -8
- package/src/slide-components/video-info.ts +4 -1
- package/src/slow-image-sources.ts +5 -1
- package/src/snapshot.ts +13 -4
- package/src/utility.ts +70 -33
package/dev/voice/voice-panel.ts
CHANGED
|
@@ -27,7 +27,10 @@ export type VoicePanelOptions = {
|
|
|
27
27
|
/** The player's AudioContext, so the mic and the video share one clock. */
|
|
28
28
|
readonly context: AudioContext;
|
|
29
29
|
/** ● Record, with a folder we can write to. Start recording, and the video. */
|
|
30
|
-
readonly onRecord: (
|
|
30
|
+
readonly onRecord: (
|
|
31
|
+
recorder: VoiceRecorder,
|
|
32
|
+
folder: FileSystemDirectoryHandle,
|
|
33
|
+
) => Promise<void>;
|
|
31
34
|
/** ■ Stop. */
|
|
32
35
|
readonly onStop: () => void;
|
|
33
36
|
/** Called after the panel closes, by × or by {@link VoicePanel.close}. */
|
|
@@ -263,7 +266,9 @@ function loadChoices(): ProcessingChoices {
|
|
|
263
266
|
* Open the panel and turn on the mic. Call this from a click, so the browser lets audio start.
|
|
264
267
|
* The browser asks for permission to use the mic the first time.
|
|
265
268
|
*/
|
|
266
|
-
export async function openVoicePanel(
|
|
269
|
+
export async function openVoicePanel(
|
|
270
|
+
options: VoicePanelOptions,
|
|
271
|
+
): Promise<VoicePanel> {
|
|
267
272
|
addStyles();
|
|
268
273
|
const panel = element("div", "vr-panel");
|
|
269
274
|
const close = element("button", "vr-close", "×");
|
|
@@ -287,10 +292,17 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
287
292
|
);
|
|
288
293
|
const choicesBox = element("div");
|
|
289
294
|
const micLine = element("div", "vr-small", "Turning on the mic…");
|
|
290
|
-
const folderName = element("b", "", "
|
|
295
|
+
const folderName = element("b", "", "…");
|
|
291
296
|
const changeFolder = element("button", "", "Change…");
|
|
292
297
|
changeFolder.style.padding = "0 6px";
|
|
293
|
-
const folderLine = element(
|
|
298
|
+
const folderLine = element(
|
|
299
|
+
"div",
|
|
300
|
+
"vr-small",
|
|
301
|
+
"Folder: ",
|
|
302
|
+
folderName,
|
|
303
|
+
" ",
|
|
304
|
+
changeFolder,
|
|
305
|
+
);
|
|
294
306
|
const record = element("button", "vr-record", "● Record");
|
|
295
307
|
record.title =
|
|
296
308
|
"Play the chirp, then record your voice while the video plays. Pause the video to stop. " +
|
|
@@ -322,19 +334,47 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
322
334
|
const savedChirpLevel = Number(localStorage.getItem(STORAGE.chirpLevel));
|
|
323
335
|
placeMark(
|
|
324
336
|
soundMark,
|
|
325
|
-
Number.isFinite(savedChirpLevel) && savedChirpLevel < 0
|
|
337
|
+
Number.isFinite(savedChirpLevel) && savedChirpLevel < 0
|
|
338
|
+
? savedChirpLevel
|
|
339
|
+
: undefined,
|
|
326
340
|
);
|
|
327
341
|
const closed = () => {
|
|
328
342
|
panel.remove();
|
|
329
343
|
options.onClose?.();
|
|
330
344
|
};
|
|
331
345
|
|
|
346
|
+
// The folder. Independent of the mic, so it shows even if the mic is refused.
|
|
347
|
+
// Not awaited: the mic should start while this click still counts as a click.
|
|
348
|
+
let folder: FileSystemDirectoryHandle | undefined;
|
|
349
|
+
const showFolder = () => {
|
|
350
|
+
folderName.textContent = folder
|
|
351
|
+
? folder.name || "browser storage"
|
|
352
|
+
: "not chosen yet";
|
|
353
|
+
};
|
|
354
|
+
void rememberedFolder().then((remembered) => {
|
|
355
|
+
// ??=, in case Change… or setFolder() got here first.
|
|
356
|
+
folder ??= remembered;
|
|
357
|
+
showFolder();
|
|
358
|
+
});
|
|
359
|
+
changeFolder.addEventListener("click", async () => {
|
|
360
|
+
changeFolder.blur();
|
|
361
|
+
try {
|
|
362
|
+
folder = (await chooseFolder()) ?? folder;
|
|
363
|
+
showFolder();
|
|
364
|
+
} catch (error) {
|
|
365
|
+
say(error instanceof Error ? error.message : String(error), true);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
332
369
|
let recorder: VoiceRecorder;
|
|
333
370
|
try {
|
|
334
371
|
recorder = await VoiceRecorder.open(options.context, loadChoices());
|
|
335
372
|
} catch (error) {
|
|
336
373
|
micLine.textContent = "No mic.";
|
|
337
|
-
say(
|
|
374
|
+
say(
|
|
375
|
+
`Couldn't turn on the mic: ${error instanceof Error ? error.message : error}`,
|
|
376
|
+
true,
|
|
377
|
+
);
|
|
338
378
|
// Leave the panel up, so you can read why.
|
|
339
379
|
close.addEventListener("click", closed);
|
|
340
380
|
throw error;
|
|
@@ -350,7 +390,8 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
350
390
|
const now = performance.now();
|
|
351
391
|
const seconds = (now - lastLevel) / 1000;
|
|
352
392
|
lastLevel = now;
|
|
353
|
-
meanSquare +=
|
|
393
|
+
meanSquare +=
|
|
394
|
+
(rms * rms - meanSquare) * (1 - Math.exp(-seconds / METER_SECONDS));
|
|
354
395
|
const peakDb = toDb(peakLevel);
|
|
355
396
|
if (peakDb >= held) {
|
|
356
397
|
held = peakDb;
|
|
@@ -375,13 +416,16 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
375
416
|
const requested = loadChoices();
|
|
376
417
|
for (const [name, got] of gotLabels) {
|
|
377
418
|
const value = actual[name];
|
|
378
|
-
got.textContent =
|
|
419
|
+
got.textContent =
|
|
420
|
+
value === undefined ? "got: ?" : `got: ${value ? "on" : "off"}`;
|
|
379
421
|
got.classList.toggle(
|
|
380
422
|
"vr-mismatch",
|
|
381
423
|
value !== undefined && value !== (requested[name] ?? false),
|
|
382
424
|
);
|
|
383
425
|
}
|
|
384
|
-
const rate = actual.sampleRate
|
|
426
|
+
const rate = actual.sampleRate
|
|
427
|
+
? ` · ${Number(actual.sampleRate) / 1000} kHz`
|
|
428
|
+
: "";
|
|
385
429
|
micLine.textContent = `Mic: ${recorder.micName || "unknown"}${rate}`;
|
|
386
430
|
};
|
|
387
431
|
for (const { name, label, help } of supportedProcessing()) {
|
|
@@ -416,20 +460,6 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
416
460
|
}
|
|
417
461
|
showSettings();
|
|
418
462
|
|
|
419
|
-
// The folder.
|
|
420
|
-
let folder = await rememberedFolder();
|
|
421
|
-
const folderTitle = () => (folder ? folder.name || "browser storage" : "not chosen yet");
|
|
422
|
-
folderName.textContent = folderTitle();
|
|
423
|
-
changeFolder.addEventListener("click", async () => {
|
|
424
|
-
changeFolder.blur();
|
|
425
|
-
try {
|
|
426
|
-
folder = (await chooseFolder()) ?? folder;
|
|
427
|
-
folderName.textContent = folderTitle();
|
|
428
|
-
} catch (error) {
|
|
429
|
-
say(error instanceof Error ? error.message : String(error), true);
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
|
|
433
463
|
// What we heard of the chirp.
|
|
434
464
|
recorder.onHeard = (result: HeardResult) => {
|
|
435
465
|
if (result.roundTripMs === undefined) {
|
|
@@ -455,9 +485,11 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
455
485
|
const seconds = Math.floor((performance.now() - started) / 1000);
|
|
456
486
|
time.textContent = `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
|
|
457
487
|
};
|
|
488
|
+
/** What the button says: ■ Stop. That's what a click does, even if the two ever disagree. */
|
|
489
|
+
let showingStop = false;
|
|
458
490
|
record.addEventListener("click", async () => {
|
|
459
491
|
record.blur();
|
|
460
|
-
if (
|
|
492
|
+
if (showingStop) {
|
|
461
493
|
options.onStop();
|
|
462
494
|
return;
|
|
463
495
|
}
|
|
@@ -465,7 +497,7 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
465
497
|
try {
|
|
466
498
|
if (!folder || !(await canWrite(folder, true))) {
|
|
467
499
|
folder = await chooseFolder();
|
|
468
|
-
|
|
500
|
+
showFolder();
|
|
469
501
|
}
|
|
470
502
|
if (!folder) {
|
|
471
503
|
say("Choose a folder for the recordings first.", true);
|
|
@@ -483,6 +515,7 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
483
515
|
const result: VoicePanel = {
|
|
484
516
|
recorder,
|
|
485
517
|
setRecording(on) {
|
|
518
|
+
showingStop = on;
|
|
486
519
|
panel.classList.toggle("vr-recording", on);
|
|
487
520
|
record.textContent = on ? "■ Stop" : "● Record";
|
|
488
521
|
window.clearInterval(clock);
|
|
@@ -495,12 +528,13 @@ export async function openVoicePanel(options: VoicePanelOptions): Promise<VoiceP
|
|
|
495
528
|
}
|
|
496
529
|
},
|
|
497
530
|
setPastEnd(ms) {
|
|
498
|
-
pastEnd.textContent =
|
|
531
|
+
pastEnd.textContent =
|
|
532
|
+
ms === undefined ? "" : `+${(ms / 1000).toFixed(1)} s past the end`;
|
|
499
533
|
},
|
|
500
534
|
say,
|
|
501
535
|
setFolder(newFolder) {
|
|
502
536
|
folder = newFolder;
|
|
503
|
-
|
|
537
|
+
showFolder();
|
|
504
538
|
},
|
|
505
539
|
async close() {
|
|
506
540
|
window.clearInterval(clock);
|
|
@@ -139,7 +139,12 @@ registerProcessor("voice-recorder", VoiceRecorderProcessor);
|
|
|
139
139
|
/** addModule() for each context only once: registering the processor twice is an error. */
|
|
140
140
|
const workletLoaded = new WeakMap<BaseAudioContext, Promise<void>>();
|
|
141
141
|
|
|
142
|
-
type Chunk = {
|
|
142
|
+
type Chunk = {
|
|
143
|
+
first: number;
|
|
144
|
+
samples: Float32Array;
|
|
145
|
+
peak: number;
|
|
146
|
+
rms: number;
|
|
147
|
+
};
|
|
143
148
|
|
|
144
149
|
export type HeardResult = {
|
|
145
150
|
/** Undefined if the chirp wasn't found: speakers off, or headphones. */
|
|
@@ -241,16 +246,22 @@ export class VoiceRecorder {
|
|
|
241
246
|
this.#choices = choices;
|
|
242
247
|
const saved = Number(localStorage.getItem(DELAY_KEY));
|
|
243
248
|
this.micDelayMs = saved > 0 ? saved : DEFAULT_DELAY_MS;
|
|
244
|
-
node.port.onmessage = (event: MessageEvent<Chunk>) =>
|
|
249
|
+
node.port.onmessage = (event: MessageEvent<Chunk>) =>
|
|
250
|
+
this.#receive(event.data);
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
/**
|
|
248
254
|
* Turn on the mic. Call this from a click, so the browser lets the audio start.
|
|
249
255
|
* The browser asks for permission to use the mic the first time.
|
|
250
256
|
*/
|
|
251
|
-
static async open(
|
|
257
|
+
static async open(
|
|
258
|
+
context: AudioContext,
|
|
259
|
+
choices: ProcessingChoices,
|
|
260
|
+
): Promise<VoiceRecorder> {
|
|
252
261
|
await workletLoaded.getOrInsertComputed(context, async () => {
|
|
253
|
-
const url = URL.createObjectURL(
|
|
262
|
+
const url = URL.createObjectURL(
|
|
263
|
+
new Blob([WORKLET], { type: "text/javascript" }),
|
|
264
|
+
);
|
|
254
265
|
try {
|
|
255
266
|
await context.audioWorklet.addModule(url);
|
|
256
267
|
} finally {
|
|
@@ -281,8 +292,12 @@ export class VoiceRecorder {
|
|
|
281
292
|
}
|
|
282
293
|
|
|
283
294
|
async #connectMic() {
|
|
284
|
-
this.#stream = await navigator.mediaDevices.getUserMedia({
|
|
285
|
-
|
|
295
|
+
this.#stream = await navigator.mediaDevices.getUserMedia({
|
|
296
|
+
audio: this.#constraints(),
|
|
297
|
+
});
|
|
298
|
+
this.#source = new MediaStreamAudioSourceNode(this.context, {
|
|
299
|
+
mediaStream: this.#stream,
|
|
300
|
+
});
|
|
286
301
|
this.#source.connect(this.#node);
|
|
287
302
|
}
|
|
288
303
|
|
|
@@ -333,7 +348,10 @@ export class VoiceRecorder {
|
|
|
333
348
|
*
|
|
334
349
|
* @param prefix The start of each file's name, usually the video's name.
|
|
335
350
|
*/
|
|
336
|
-
async start(
|
|
351
|
+
async start(
|
|
352
|
+
folder: FileSystemDirectoryHandle,
|
|
353
|
+
prefix: string,
|
|
354
|
+
): Promise<void> {
|
|
337
355
|
if (this.#session) return;
|
|
338
356
|
await this.context.resume();
|
|
339
357
|
const chirp = chirpSamples(SAMPLE_RATE);
|
|
@@ -346,7 +364,11 @@ export class VoiceRecorder {
|
|
|
346
364
|
session.current = file;
|
|
347
365
|
this.#listening = { file, samples: chirp };
|
|
348
366
|
// Straight to the speakers, so the player's mute doesn't silence it.
|
|
349
|
-
const buffer = new AudioBuffer({
|
|
367
|
+
const buffer = new AudioBuffer({
|
|
368
|
+
numberOfChannels: 1,
|
|
369
|
+
length: chirp.length,
|
|
370
|
+
sampleRate: SAMPLE_RATE,
|
|
371
|
+
});
|
|
350
372
|
buffer.copyToChannel(chirp, 0);
|
|
351
373
|
const node = new AudioBufferSourceNode(this.context, { buffer });
|
|
352
374
|
node.connect(this.context.destination);
|
|
@@ -354,7 +376,10 @@ export class VoiceRecorder {
|
|
|
354
376
|
node.start(when);
|
|
355
377
|
const videoStarts = when + buffer.duration + AFTER_CHIRP_S;
|
|
356
378
|
await new Promise((resolve) =>
|
|
357
|
-
setTimeout(
|
|
379
|
+
setTimeout(
|
|
380
|
+
resolve,
|
|
381
|
+
Math.max(0, videoStarts - this.context.currentTime) * 1000,
|
|
382
|
+
),
|
|
358
383
|
);
|
|
359
384
|
}
|
|
360
385
|
|
|
@@ -448,7 +473,11 @@ export class VoiceRecorder {
|
|
|
448
473
|
folder: session.folder,
|
|
449
474
|
name,
|
|
450
475
|
startFrame,
|
|
451
|
-
buffer: new AudioBuffer({
|
|
476
|
+
buffer: new AudioBuffer({
|
|
477
|
+
numberOfChannels: 1,
|
|
478
|
+
length: 10 * SAMPLE_RATE,
|
|
479
|
+
sampleRate: SAMPLE_RATE,
|
|
480
|
+
}),
|
|
452
481
|
frames: 0,
|
|
453
482
|
handle,
|
|
454
483
|
writing: handle
|
|
@@ -484,7 +513,10 @@ export class VoiceRecorder {
|
|
|
484
513
|
(file.endFrame ?? Infinity) - chunk.first,
|
|
485
514
|
);
|
|
486
515
|
if (to > from) this.#append(file, chunk.samples.subarray(from, to));
|
|
487
|
-
if (
|
|
516
|
+
if (
|
|
517
|
+
file.endFrame !== undefined &&
|
|
518
|
+
chunk.first + chunk.samples.length >= file.endFrame
|
|
519
|
+
) {
|
|
488
520
|
void this.#finish(file);
|
|
489
521
|
}
|
|
490
522
|
}
|
|
@@ -499,7 +531,9 @@ export class VoiceRecorder {
|
|
|
499
531
|
length: Math.max(needed, file.buffer.length * 2),
|
|
500
532
|
sampleRate: SAMPLE_RATE,
|
|
501
533
|
});
|
|
502
|
-
bigger
|
|
534
|
+
bigger
|
|
535
|
+
.getChannelData(0)
|
|
536
|
+
.set(file.buffer.getChannelData(0).subarray(0, file.frames));
|
|
503
537
|
file.buffer = bigger;
|
|
504
538
|
}
|
|
505
539
|
file.buffer.getChannelData(0).set(samples, file.frames);
|
|
@@ -518,10 +552,19 @@ export class VoiceRecorder {
|
|
|
518
552
|
if (!listening) return;
|
|
519
553
|
const { file, samples } = listening;
|
|
520
554
|
// The file starts when the chirp was played, so a sound that took no time at all would be at 0.
|
|
521
|
-
if (
|
|
555
|
+
if (
|
|
556
|
+
!file.done &&
|
|
557
|
+
file.frames < samples.length + SEARCH_AFTER_S * SAMPLE_RATE
|
|
558
|
+
)
|
|
559
|
+
return;
|
|
522
560
|
this.#listening = undefined;
|
|
523
561
|
const recording = file.buffer.getChannelData(0).subarray(0, file.frames);
|
|
524
|
-
const found = findSound(
|
|
562
|
+
const found = findSound(
|
|
563
|
+
recording,
|
|
564
|
+
samples,
|
|
565
|
+
0,
|
|
566
|
+
SEARCH_AFTER_S * SAMPLE_RATE,
|
|
567
|
+
);
|
|
525
568
|
const heard = found.match > HEARD;
|
|
526
569
|
const result: HeardResult = {
|
|
527
570
|
roundTripMs: heard ? (found.position / SAMPLE_RATE) * 1000 : undefined,
|
|
@@ -548,7 +591,11 @@ export class VoiceRecorder {
|
|
|
548
591
|
const frames = file.frames;
|
|
549
592
|
try {
|
|
550
593
|
const stream = await file.writing;
|
|
551
|
-
await stream.write({
|
|
594
|
+
await stream.write({
|
|
595
|
+
type: "write",
|
|
596
|
+
position: 0,
|
|
597
|
+
data: wavHeader(frames),
|
|
598
|
+
});
|
|
552
599
|
await stream.close();
|
|
553
600
|
const handle = await file.handle;
|
|
554
601
|
if (file.clipStart === undefined) {
|
|
@@ -562,10 +609,19 @@ export class VoiceRecorder {
|
|
|
562
609
|
length: Math.max(1, frames),
|
|
563
610
|
sampleRate: SAMPLE_RATE,
|
|
564
611
|
});
|
|
565
|
-
buffer.copyToChannel(
|
|
612
|
+
buffer.copyToChannel(
|
|
613
|
+
file.buffer.getChannelData(0).subarray(0, frames),
|
|
614
|
+
0,
|
|
615
|
+
);
|
|
566
616
|
const trimMs = this.#trimMs(file);
|
|
567
|
-
const lengthMs =
|
|
568
|
-
|
|
617
|
+
const lengthMs =
|
|
618
|
+
((file.clipEnd ?? file.clipStart) - file.clipStart) * 1000;
|
|
619
|
+
file.resolve({
|
|
620
|
+
url: await addLocalFile(handle),
|
|
621
|
+
buffer,
|
|
622
|
+
trimMs,
|
|
623
|
+
lengthMs,
|
|
624
|
+
});
|
|
569
625
|
} catch (error) {
|
|
570
626
|
file.reject(error);
|
|
571
627
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-builder.js","sourceRoot":"","sources":["../../dev/audio-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACK,MAAM,CAAc;IAE5B,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,YAAY,eAAuB,EAAE,UAAU,GAAG,KAAK;QACrD,sEAAsE;QACtE,yCAAyC;QACzC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAC3B,CAAC,EACD,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,UAAU,CA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32
|
/* ── Vertical resize handle between left/right columns ──────────────── */
|
|
29
33
|
|
|
@@ -139,7 +143,7 @@ body {
|
|
|
139
143
|
display: block;
|
|
140
144
|
width: 100%;
|
|
141
145
|
min-height: 28px;
|
|
142
|
-
max-height: 168px;
|
|
146
|
+
max-height: 168px; /* cap at 6 rows × 28 px */
|
|
143
147
|
cursor: crosshair;
|
|
144
148
|
border-bottom: 1px solid #bbb;
|
|
145
149
|
box-sizing: border-box;
|
|
@@ -208,6 +212,9 @@ body {
|
|
|
208
212
|
font-style: italic;
|
|
209
213
|
color: #777;
|
|
210
214
|
}
|
|
215
|
+
#transcriptView .tv-problem {
|
|
216
|
+
color: #b00020;
|
|
217
|
+
}
|
|
211
218
|
#transcriptView .tv-word {
|
|
212
219
|
cursor: pointer;
|
|
213
220
|
border-radius: 2px;
|
|
@@ -337,6 +344,11 @@ body {
|
|
|
337
344
|
flex-grow: 1;
|
|
338
345
|
}
|
|
339
346
|
|
|
347
|
+
/* About 60% of the default width, to make room for "local". */
|
|
348
|
+
#playPositionSeconds {
|
|
349
|
+
width: 6.5em;
|
|
350
|
+
}
|
|
351
|
+
|
|
340
352
|
/* ── History dialog ──────────────────────────────────────────────────── */
|
|
341
353
|
|
|
342
354
|
#historyList li.selected {
|
|
@@ -359,7 +371,6 @@ body {
|
|
|
359
371
|
outline-offset: -2px;
|
|
360
372
|
}
|
|
361
373
|
|
|
362
|
-
|
|
363
374
|
/* ── Component picker dialog ─────────────────────────────────────────── */
|
|
364
375
|
|
|
365
376
|
.component-picker li.selected {
|