// fallow-ignore-file unused-file code-duplication complexity /** * Audio Extractor Service * * Extracts audio from media elements in the composition HTML, * applies timeline positioning, and mixes into a single audio track. */ import { spawn } from "node:child_process"; import { existsSync, mkdirSync, rmSync, readFileSync } from "node:fs"; import { join, dirname } from "node:path"; import { getFfmpegBinary, trackChildProcess } from "@hyperframes/engine"; export interface AudioElement { id: string; src: string; start: number; duration: number; mediaStart: number; volume: number; tagName: "audio" | "video"; } export interface AudioTrack { id: string; srcPath: string; start: number; duration: number; mediaStart: number; volume: number; } /** * Parse audio/video elements from HTML to find media with audio. */ export function parseAudioElements(html: string): AudioElement[] { const elements: AudioElement[] = []; // Match