UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

51 lines (50 loc) • 1.93 kB
/** * Azure Cognitive Services Speech-to-Text Handler * * Implementation of STT using Azure Speech Services. * * @module voice/providers/AzureSTT */ import type { TTSAudioFormat, STTCredentials, STTHandler, STTLanguage, STTOptions, STTResult } from "../../types/index.js"; /** * Azure Cognitive Services Speech-to-Text Handler * * Supports speech recognition with custom models and detailed output. * * @see https://docs.microsoft.com/azure/cognitive-services/speech-service/ */ export declare class AzureSTT implements STTHandler { private readonly apiKey; private readonly region; /** * Maximum audio duration in seconds (60s — Azure's REST API for short audio * documented limit on `/speech/recognition/conversation/cognitiveservices/v1`). * For longer audio, use Azure Batch Transcription (not yet implemented) or * pre-segment the input. */ readonly maxAudioDuration = 60; /** * REST short-audio recognition has no stream. `transcribeStream()` on the * SDK streams this handler through the generic chunked adapter. */ readonly supportsStreaming = false; /** * @param apiKeyOrCredentials - The `credentials.stt.azure` slice (`apiKey`, * `region`), or an API key (the original positional form). * `AZURE_SPEECH_KEY` / `AZURE_SPEECH_REGION` fill whatever is left out. * @param region - Region, positional form only. */ constructor(apiKeyOrCredentials?: string | STTCredentials["azure"], region?: string); isConfigured(): boolean; getSupportedFormats(): TTSAudioFormat[]; getSupportedLanguages(): Promise<STTLanguage[]>; transcribe(audio: Buffer | ArrayBuffer, options?: STTOptions): Promise<STTResult>; /** * Get Content-Type header for audio format */ private getContentType; /** * Convert Azure ticks (100ns units) to seconds */ private ticksToSeconds; }