murmuraba
Version:
Real-time audio noise reduction with advanced chunked processing for web applications
75 lines • 2.46 kB
TypeScript
/**
* Time constants for consistent duration handling across the application
*/
export declare const TIME_UNITS: {
readonly MILLISECOND: 1;
readonly SECOND: 1000;
readonly MINUTE: number;
readonly HOUR: number;
readonly DAY: number;
};
/**
* Common durations in milliseconds for audio processing
*/
export declare const AUDIO_DURATIONS: {
/** Common chunk size for real-time processing */
readonly CHUNK_DEFAULT: number;
/** Minimum chunk size for meaningful processing */
readonly CHUNK_MIN: number;
/** Maximum chunk size to prevent memory issues */
readonly CHUNK_MAX: number;
/** Typical recording session length */
readonly SESSION_TYPICAL: number;
/** Maximum recording session length */
readonly SESSION_MAX: number;
};
/**
* Format thresholds for automatic format selection
*/
export declare const FORMAT_THRESHOLDS: {
/** Show milliseconds below this threshold */
readonly SHOW_MS: number;
/** Show seconds only below this threshold */
readonly SHOW_SECONDS: number;
/** Show hours above this threshold */
readonly SHOW_HOURS: number;
};
/**
* Performance thresholds for audio processing
*/
export declare const PERFORMANCE_THRESHOLDS: {
/** Acceptable processing latency in milliseconds */
readonly LATENCY_GOOD: 50;
/** Warning threshold for processing latency */
readonly LATENCY_WARNING: 100;
/** Critical threshold for processing latency */
readonly LATENCY_CRITICAL: 200;
/** Real-time processing budget per chunk */
readonly REALTIME_BUDGET: 0.8;
};
/**
* Utility functions for working with time constants
*/
export declare const timeUtils: {
/**
* Convert human-readable time to milliseconds
*/
readonly toMs: (value: number, unit: keyof typeof TIME_UNITS) => number;
/**
* Convert milliseconds to human-readable time
*/
readonly fromMs: (ms: number, unit: keyof typeof TIME_UNITS) => number;
/**
* Check if a duration is within acceptable limits for audio processing
*/
readonly isValidAudioDuration: (ms: number) => boolean;
/**
* Get recommended chunk size based on total duration
*/
readonly getRecommendedChunkSize: (totalDurationMs: number) => number;
/**
* Categorize processing latency
*/
readonly categorizeLatency: (latencyMs: number) => "good" | "warning" | "critical";
};
//# sourceMappingURL=time-constants.d.ts.map