Files
archived-orca/src/cli/runtime/serve-speech-recognizer.ts
T
Kelvin Amoaba 6d24014dff refactor(speech): remove sherpa-onnx
transcribe-cpp is now the only on-device engine on every platform, so
the sherpa-onnx packages, their packaging (extraResources, the darwin
libonnxruntime prune, the native-variant assert and the Linux libstdc++
exemption), the sherpa recognizer in the speech process and the
per-model engine choice all go. Hotwords are written as plain terms.
2026-11-09 18:01:55 +00:00

24 lines
895 B
TypeScript

import { dirname, join } from 'node:path'
import { hasSpeechEnginePackage } from '../../shared/speech-recognizer-package'
/**
* The installed app's node_modules holding transcribe-cpp, for orcad's on-device dictation
* (#31174). electron-builder puts it in `resources/node_modules`, beside the app root; a dev
* checkout keeps it in node_modules.
*
* Not on Windows: a loaded addon locks its files for the server's life, which would make the next
* app update fail to replace them. Windows orcad keeps cloud dictation only.
*/
export function findAppSpeechRecognizerDir(
appRoot: string,
platform: string = process.platform,
arch: string = process.arch
): string | undefined {
if (platform === 'win32') {
return undefined
}
return [join(dirname(appRoot), 'node_modules'), join(appRoot, 'node_modules')].find((dir) =>
hasSpeechEnginePackage(dir, platform, arch)
)
}