/** * CREPE (Convolutional REcurrent Pitch Estimator) implementation * Neural network-based monophonic pitch detection */ /** * CREPE model configuration */ export interface CREPEConfig { modelUrl?: string; modelSize?: 'tiny' | 'small' | 'medium' | 'large' | 'full'; viterbi?: boolean; centerFrequency?: number; stepSize?: number; } /** * CREPE prediction result */ export interface CREPEPrediction { frequency: number; confidence: number; activations?: Float32Array; time?: number; } /** * CREPE model wrapper */ export declare class CREPEModel { private modelManager; private config; private isReady; constructor(config?: CREPEConfig); /** * Initialize and load CREPE model */ initialize(): Promise; /** * Predict pitch from audio frame */ predict(audioFrame: Float32Array, sampleRate?: number): Promise; /** * Predict pitch from multiple frames (batch processing) */ predictBatch(frames: Float32Array[], sampleRate?: number): Promise; /** * Resample audio to 16kHz (CREPE's expected sample rate) */ private resampleTo16kHz; /** * Extract 1024-sample frame from center of audio */ private extractFrame; /** * Normalize frame to [-1, 1] with mean removal */ private normalizeFrame; /** * Convert model activations to frequency and confidence */ private activationsToFrequency; /** * Convert bin index to frequency with interpolation */ private binToFrequency; /** * Convert frequency to CREPE bin */ frequencyToBin(frequency: number): number; /** * Apply Viterbi smoothing to sequence of predictions */ viterbiSmooth(predictions: CREPEPrediction[]): CREPEPrediction[]; /** * Get CREPE configuration */ getConfig(): Readonly>; /** * Check if model is ready */ isInitialized(): boolean; /** * Dispose model and free memory */ dispose(): void; } /** * Quick utility: Get pitch from audio using CREPE */ export declare function detectPitchCREPE(audio: Float32Array, sampleRate?: number, modelUrl?: string): Promise; /** * CREPE frequency range utilities */ export declare const CREPEUtils: { MIN_FREQ: number; MAX_FREQ: number; SAMPLE_RATE: number; FRAME_SIZE: number; BINS: number; /** * Check if frequency is in CREPE range */ isInRange(frequency: number): boolean; /** * Get nearest valid CREPE frequency */ clamp(frequency: number): number; /** * Convert MIDI to CREPE bin */ midiToBin(midi: number): number; /** * Convert CREPE bin to MIDI */ binToMidi(bin: number): number; };