UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

34 lines (33 loc) 945 B
/** * Shared utility: infer a `TTSAudioFormat` from a file path. * * Used by the CLI generate/stream handlers (m2) to set `stt.format` so * `STTProcessor.transcribe()` can fail fast on incompatible provider/format * combinations (e.g. MP3 to azure-stt). Pulled into a single helper to * avoid duplicating the 11-element format list across two CLI handlers. */ const VALID_FORMATS = [ "mp3", "wav", "ogg", "opus", "m4a", "flac", "webm", "mp4", "mpeg", "mpga", "pcm16", ]; /** * Returns the `TTSAudioFormat` that matches the file extension of `path`, * or `undefined` when the path is missing or its extension isn't a known * audio format. The check is case-insensitive. */ export function inferAudioFormatFromPath(path) { if (!path) { return undefined; } const ext = path.toLowerCase().split(".").pop(); return ext && VALID_FORMATS.includes(ext) ? ext : undefined; }