import { LeopardInputOptions, LeopardOptions, LeopardTranscript } from './types'; /** * Node.js binding for Leopard speech-to-text engine. * * Performs the calls to the Leopard node library. Does some basic parameter validation to prevent * errors occurring in the library layer. Provides clearer error messages in native JavaScript. */ export declare class Leopard { private _pvLeopard; private _handle; private readonly _version; private readonly _sampleRate; /** * Creates an instance of Leopard. * @param {string} accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/). * @param {LeopardOptions} options Optional configuration arguments. * @param {string} options.modelPath The path to save and use the model from (.pv extension) * @param {string} options.device String representation of the device (e.g., CPU or GPU) to use for inference. * If set to `best`, the most suitable device is selected automatically. If set to `gpu`, the engine uses the * first available GPU device. To select a specific GPU device, set this argument to `gpu:${GPU_INDEX}`, where * `${GPU_INDEX}` is the index of the target GPU. If set to `cpu`, the engine will run on the CPU with the * default number of threads. To specify the number of threads, set this argument to `cpu:${NUM_THREADS}`, * where `${NUM_THREADS}` is the desired number of threads. * @param {string} options.libraryPath the path to the Leopard dynamic library (.node extension) * @param {boolean} options.enableAutomaticPunctuation Flag to enable automatic punctuation insertion. * @param {boolean} options.enableDiarization Flag to enable speaker diarization, which allows Leopard to * differentiate speakers as part of the transcription process. Word metadata will include a `speakerTag` * to identify unique speakers. */ constructor(accessKey: string, options?: LeopardOptions); /** * @returns the audio sampling rate accepted by the process function * @see {@link process} */ get sampleRate(): number; /** * @returns the version of the Leopard engine */ get version(): string; /** * Processes a given audio data and returns its transcription. * * @param {Int16Array} pcm Audio data. The audio needs to have a sample rate equal to `Leopard.sampleRate` and be 16-bit linearly-encoded. * This function operates on single-channel audio. If you wish to process data in a different * sample rate or format consider using `Leopard.processFile()`. * @returns {LeopardTranscript} LeopardTranscript object which contains the transcription results of the engine. */ process(pcm: Int16Array): LeopardTranscript; /** * Processes a given audio file and returns its transcription. * * @param {string} audioPath Absolute path to the audio file. * The file needs to have a sample rate equal to or greater than `.sampleRate`. * The supported formats are: `FLAC`, `MP3`, `Ogg`, `WAV`, `WebM`, `MP4/m4a (AAC)`, and `3gp (AMR)` * @returns {LeopardTranscript} object which contains the transcription results of the engine. */ processFile(audioPath: string): LeopardTranscript; /** * Releases the resources acquired by Leopard. * * Be sure to call this when finished with the instance * to reclaim the memory that was allocated by the C library. */ release(): void; /** * Lists all available devices that Leopard can use for inference. Each entry in the list can be the `device` argument * of the constructor. * * @returns List of all available devices that Leopard can use for inference. */ static listAvailableDevices(options?: LeopardInputOptions): string[]; private handlePvStatus; } //# sourceMappingURL=leopard.d.ts.map