import type { AudioBase, IAudio } from '../interfaces/core'; import { HttpClient } from '../utils/httpClient'; interface TranscriptSegment { start: number; end: number; text: string; } interface TranscriptResponse { wordTimestamps?: TranscriptSegment[]; text?: string; } /** * The base Audio class * @remarks * Use this to initialize an audio stored in VideoDB */ export declare class Audio implements IAudio { #private; readonly id: string; readonly collectionId: string; readonly length: number; readonly name: string; readonly size: string; readonly userId: string; transcript?: TranscriptSegment[]; transcriptText?: string; /** * Initializes a VideoDB Instance * @param http - HttpClient object * @param data - Data needed to initialize an audio instance */ constructor(http: HttpClient, data: AudioBase); /** * Returns an empty promise that resolves when the audio is deleted * @returns A promise that resolves when delete is successful * @throws an InvalidRequestError if the request fails */ delete: () => Promise>>; /** * Generate the signed url of the audio * @returns The signed url of the audio */ generateUrl: () => Promise; /** * Internal method to fetch transcript */ private _fetchTranscript; /** * Get timestamped transcript segments for the audio * @param start - Start time in seconds (must be >= 0 and <= end) * @param end - End time in seconds (must be >= 0 and >= start) * @param segmenter - How to split the transcript into segments. * Must be one of `Segmenter.word` (default, one segment per word), * `Segmenter.sentence` (one segment per sentence), or * `Segmenter.time` (fixed-duration segments controlled by `length`) * @param length - Duration in seconds for each segment when * segmenter is `Segmenter.time` (default 1) * @param force - Force re-fetch transcript from the server, bypassing the local cache * @throws {VideodbError} If segmenter is not a valid value, or if * start/end are negative or start > end * @returns List of transcript segments */ getTranscript: (start?: number, end?: number, segmenter?: string, length?: number, force?: boolean) => Promise; /** * Get plain text transcript for the audio * @param start - Start time in seconds * @param end - End time in seconds * @returns Full transcript text as string */ getTranscriptText: (start?: number, end?: number) => Promise; /** * Generate transcript for the audio * @param force - Force generate new transcript * @param languageCode - Language code of the spoken audio * @returns Success dict if transcript generated */ generateTranscript: (force?: boolean, languageCode?: string) => Promise<{ success: boolean; message: string; } | TranscriptResponse>; } export {};