@senad-d/micme 0.3.2 → 0.3.4
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/CHANGELOG.md +9 -0
- package/README.md +5 -2
- package/SECURITY.md +1 -1
- package/img/demo.gif +0 -0
- package/img/micme_logo.svg +3 -0
- package/package.json +16 -6
- package/scripts/check-format.mjs +89 -0
- package/scripts/doctor.mjs +75 -18
- package/scripts/publish-npm.mjs +179 -74
- package/src/audio.ts +82 -24
- package/src/backends.ts +28 -21
- package/src/config.ts +51 -10
- package/src/editor.ts +6 -1
- package/src/extension.ts +168 -103
- package/src/models.ts +72 -27
- package/src/processes.ts +52 -17
- package/src/settings.ts +116 -65
- package/src/streaming.ts +151 -32
- package/src/terminal-text.ts +42 -4
- package/src/transcription.ts +4 -4
package/src/transcription.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { basename, join } from "node:path";
|
|
|
5
5
|
import { resolveTranscriptionPlan, formatTranscriptionPlan } from "./backends.ts";
|
|
6
6
|
import { env, getTranscribeTimeoutMs, getTranslateToEnglishLanguage } from "./config.ts";
|
|
7
7
|
import { ensureWhisperCppModel, getPythonWhisperModelName } from "./models.ts";
|
|
8
|
-
import { formatRunExit, replacePlaceholders, runProcess, runShell } from "./processes.ts";
|
|
8
|
+
import { formatProcessOutput, formatRunExit, replacePlaceholders, runProcess, runShell } from "./processes.ts";
|
|
9
9
|
|
|
10
10
|
export { getWhisperCppBinary, getWhisperStreamBinary, resolveExecutableConfig } from "./backends.ts";
|
|
11
11
|
|
|
@@ -34,7 +34,7 @@ export async function transcribeWithCustomCommand(template: string, audioPath: s
|
|
|
34
34
|
const command = replacePlaceholders(template, { audio: audioPath, tempDir, transcript: transcriptPath });
|
|
35
35
|
const result = await runShell(command, getTranscribeTimeoutMs());
|
|
36
36
|
if (result.code !== 0) {
|
|
37
|
-
throw new Error(`MICME_TRANSCRIBE_COMMAND failed (${formatRunExit(result)}):\n${result.stderr
|
|
37
|
+
throw new Error(`MICME_TRANSCRIBE_COMMAND failed (${formatRunExit(result)}):\n${formatProcessOutput(result.stderr, result.stdout)}`);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (existsSync(transcriptPath)) {
|
|
@@ -66,7 +66,7 @@ export async function transcribeWithWhisperCpp(
|
|
|
66
66
|
|
|
67
67
|
const result = await runProcess(binary, args, getTranscribeTimeoutMs());
|
|
68
68
|
if (result.code !== 0) {
|
|
69
|
-
throw new Error(`whisper.cpp failed (${formatRunExit(result)}):\n${result.stderr
|
|
69
|
+
throw new Error(`whisper.cpp failed (${formatRunExit(result)}):\n${formatProcessOutput(result.stderr, result.stdout)}`);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
const outputPath = `${outputBase}.txt`;
|
|
@@ -111,7 +111,7 @@ export async function transcribeWithOpenAiWhisper(binary: string, audioPath: str
|
|
|
111
111
|
|
|
112
112
|
const result = await runProcess(binary, args, getTranscribeTimeoutMs());
|
|
113
113
|
if (result.code !== 0) {
|
|
114
|
-
throw new Error(`openai-whisper failed (${formatRunExit(result)}):\n${result.stderr
|
|
114
|
+
throw new Error(`openai-whisper failed (${formatRunExit(result)}):\n${formatProcessOutput(result.stderr, result.stdout)}`);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
const txtName = basename(audioPath).replace(/\.[^.]+$/, ".txt");
|