Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
chore: formatting
Gabriel Stein4d5e659525e9
diff --git a/src/helpers/modelManagerBridge.js b/src/helpers/modelManagerBridge.jsindex 6ffcac405..43bfa73f2 100644--- a/src/helpers/modelManagerBridge.js+++ b/src/helpers/modelManagerBridge.js@@ -144,17 +144,22 @@ class ModelManager {await this.ensureModelsDirExists();const downloadUrl = this.getDownloadUrl(provider, model);- await this.downloadFile(downloadUrl, tempPath, (progress, downloadedSize, totalSize) => {- this.downloadProgress.set(modelId, {- modelId,- progress,- downloadedSize,- totalSize,- });- if (onProgress) {- onProgress(progress, downloadedSize, totalSize);- }- }, modelId);+ await this.downloadFile(+ downloadUrl,+ tempPath,+ (progress, downloadedSize, totalSize) => {+ this.downloadProgress.set(modelId, {+ modelId,+ progress,+ downloadedSize,+ totalSize,+ });+ if (onProgress) {+ onProgress(progress, downloadedSize, totalSize);+ }+ },+ modelId+ );const stats = await fsPromises.stat(tempPath);if (stats.size < MIN_FILE_SIZE) {@@ -262,7 +267,11 @@ class ModelManager {// Throttle progress updates to prevent UI flashingconst now = Date.now();- if (onProgress && totalSize > 0 && (now - lastProgressUpdate >= PROGRESS_THROTTLE_MS || downloadedSize >= totalSize)) {+ if (+ onProgress &&+ totalSize > 0 &&+ (now - lastProgressUpdate >= PROGRESS_THROTTLE_MS || downloadedSize >= totalSize)+ ) {lastProgressUpdate = now;const progress = (downloadedSize / totalSize) * 100;onProgress(progress, downloadedSize, totalSize);@@ -277,7 +286,11 @@ class ModelManager {if (error) {// Check if this was a cancellation- if (error.code === "ERR_STREAM_PREMATURE_CLOSE" && modelId && !this.activeDownloads.has(modelId)) {+ if (+ error.code === "ERR_STREAM_PREMATURE_CLOSE" &&+ modelId &&+ !this.activeDownloads.has(modelId)+ ) {cleanup(() => {reject(new ModelError("Download cancelled by user", "DOWNLOAD_CANCELLED", {diff --git a/src/helpers/whisper.js b/src/helpers/whisper.jsindex f9ed8d6cb..cdc93e3b0 100644--- a/src/helpers/whisper.js+++ b/src/helpers/whisper.js@@ -788,9 +788,7 @@ class WhisperManager {// Handle whisper.cpp JSON format (CLI mode)if (result.transcription && Array.isArray(result.transcription)) {- const text = this.normalizeWhitespace(- result.transcription.map((seg) => seg.text).join("")- );+ const text = this.normalizeWhitespace(result.transcription.map((seg) => seg.text).join(""));if (!text || this.isBlankAudioMarker(text)) {return { success: false, message: "No audio detected" };}@@ -799,8 +797,7 @@ class WhisperManager {// Handle whisper-server format (has "text" field directly)if (result.text !== undefined) {- const text =- typeof result.text === "string" ? this.normalizeWhitespace(result.text) : "";+ const text = typeof result.text === "string" ? this.normalizeWhitespace(result.text) : "";if (!text || this.isBlankAudioMarker(text)) {return { success: false, message: "No audio detected" };}diff --git a/src/helpers/whisperServer.js b/src/helpers/whisperServer.jsindex 5557c3897..fea76a306 100644--- a/src/helpers/whisperServer.js+++ b/src/helpers/whisperServer.js@@ -209,14 +209,7 @@ class WhisperServerManager {const ffmpegPath = this.getFFmpegPath();const spawnEnv = { ...process.env };- const args = [- "--model",- modelPath,- "--host",- "127.0.0.1",- "--port",- String(this.port),- ];+ const args = ["--model", modelPath, "--host", "127.0.0.1", "--port", String(this.port)];// Only add --convert flag if FFmpeg is availablethis.canConvert = !!ffmpegPath;