type Json = Record; export declare const AUDIO_IMPORT_VERSION = 1; /** The buffer name the runtime plays each slot's sample under (engine-core PACKAGE_SLOT_TO_RUNTIME_SOUND). */ export declare const SLOT_BUFFER: Record; /** Slots whose recording is kept but that today's portable runtime does not play from a package. */ export declare const NOT_CONSUMED: Record; export interface AudioImportOptions { source: string; out: string; sim?: 'auto' | 'beamng' | 'ac'; vehicle?: string; config?: string; map?: string; beamngRoot?: string; cylinders?: number; /** An existing vehicle-package.json (or its directory, or an audio.json) whose gain / load-mix / muffling to keep. */ basePackage?: string; prefer?: 'exterior' | 'interior'; acNativeRungs?: boolean; modUrl?: string; python?: string; vgmstream?: string; cacheDir?: string; } export interface SlotMapSource { /** A mod folder / .zip, an AC car folder / .bank, the BeamNG install (beamng-base), or a folder of recordings. */ path?: string; /** * `beamng-base`: the BeamNG.drive install itself — slots routed to it name a stock `event` (+ an exact `sample`). * `recording`: real recordings of the car — slots routed to it name a `file` (relative to `path`, else the map). */ sim?: 'auto' | 'beamng' | 'ac' | 'beamng-base' | 'recording'; vehicle?: string; config?: string; modUrl?: string; mod?: string; kind?: string; prefer?: 'exterior' | 'interior'; } /** One recording request: which take, from which source. */ export interface SlotPick { source?: string; /** AC: the subsound name. BeamNG mod: a jbeam field, the value it names, or a shipped file (path or stem). Stock event: the exact take. */ sample?: string; field?: string; /** A stock FMOD event (`event:>Vehicle>Electrics>Horns>BM1_V1` or `event:/...`), or on a BeamNG mod the jbeam field name. */ event?: string; /** A recording file (recording sources). */ file?: string; /** Repeat this piece N times inside `concat` (a horn's loop). */ repeat?: number; /** Keep only this window of the recording, seconds. */ trim?: { startS?: number; endS?: number; }; } export interface SlotMapEntry extends SlotPick { /** engineLadder / exhaustLadder: the shipped blend to use (name, or art/sound/blends/.sfxBlend2D.json). */ blend?: string; /** The real car has no such part: `notFitted: "reason"`, or `absent: "not-fitted"` with `reason`. */ notFitted?: string; absent?: string; reason?: string; /** Leave the slot empty with this reason. */ empty?: string; /** Several pieces played in order as one recording (a stock horn's start + loop + end). */ concat?: SlotPick[]; } export interface SlotMap { sources?: Record; slots?: Record; /** blend / engineBlend / exhaustBlend: a BeamNG blend the mod ships that no selected part names. */ ladder?: { source?: string; rpm?: Record; prefer?: 'exterior' | 'interior'; nativeRungs?: boolean; blend?: string; engineBlend?: string; exhaustBlend?: string; /** A stock FMOD event that plays one loop re-pitched by RPM (an EV motor): the ladder is built from it. */ event?: string; /** Rung rpms for an event ladder (default 1000, then every 2000 up to the motor's maxRPM). */ rungs?: number[]; maxRpm?: number; }; cylinders?: number; strokes?: number; crankLayout?: string; /** The audio block's mix fields, stated outright (they win over --base-package, the mod and the defaults). */ engineGainDb?: number; exhaustGainDb?: number; minLoadMix?: number; maxLoadMix?: number; muffling?: number; bankId?: string; modUrl?: string; } interface Emitted { wav: string; rpm?: number; provenance: Json; alternatives?: string[]; } interface Ladder { name: string; eventName?: string; rows: Emitted[][]; provenance: Json; note?: string; side?: string; motor?: boolean; } interface Inventory { sim: string; requested?: Record; source: Json; traits?: { induction?: string | null; gearbox?: string | null; electric?: boolean; }; ladders: { engine: Ladder | null; exhaust: Ladder | null; }; ladderNotes?: string[]; slots: Record; reasons?: Record; absentReason?: string; unmapped?: Json[]; warnings?: string[]; cylinders?: { count?: number | null; state?: string; detail?: string; } | null; /** BeamNG: the mix fields the selected parts' soundConfig / soundConfigExhaust state. */ mix?: Partial>; stockEvents?: Json | null; } /** * The runtime reads these five from every audio block; one missing reaches Web Audio as NaN (`setValueAtTime ... * non-finite`), which stops the frame loop: the car boards, never moves, and plays nothing (R34 1.0.9). */ export declare const MIX_FIELDS: readonly ["engineGainDb", "exhaustGainDb", "minLoadMix", "maxLoadMix", "muffling"]; export type MixField = typeof MIX_FIELDS[number]; /** The engine's own BeamNG-blend defaults (engine-core beamngBlend.ts: importBeamngBlend / buildBeamngBank). */ export declare const MIX_DEFAULTS: Record; /** Where each mix field comes from: --map, then --base-package, then the ladder's mod, then the main mod, then the default. */ export declare function resolveMix(layers: Array<{ label: string; values: Partial> | undefined; from?: Partial>; }>): { values: Record; from: Record; }; export interface SlotDecision { slot: string; status: 'sourced' | 'not-fitted' | 'combined-with-engine' | 'from-engine-ladder' | 'alias' | 'empty'; consumed: boolean; source?: string; file?: string; provenance?: Json; reason?: string; alternatives?: string[]; } export interface AudioImportResult { ok: boolean; out: string; audioJson: string; reportJson: string; audio: Json; slots: SlotDecision[]; empty: string[]; sources: Record; /** Where each of the audio block's mix fields came from. */ mix: Record; notes: string[]; warnings: string[]; } export declare function pluginBin(): string; export declare function runInventory(source: string, staging: string, sim: string, options: Json, python?: string): Inventory; interface Pcm { rate: number; channels: number; data: Buffer; } /** A 16-bit PCM WAV's format and sample bytes (what the importer writes). */ export declare function readPcm16(path: string): Pcm; /** Cut a recording to a window (a blow-off take inside a 41 s file); recorded as a `trim` transform. */ export declare function applyTrim(emitted: T, trim: SlotPick['trim'] | undefined, dir: string, slot: string): T; /** Several real recordings played in order as one (a stock horn's start + loop + end). Formats must match. */ export declare function composeWavs(pieces: Array<{ wav: string; repeat: number; trim?: SlotPick['trim']; }>, dir: string, slot: string): string; /** `art/sound/blends/RB26DETT_ENG.sfxBlend2D.json` or `RB26DETT_ENG` -> `RB26DETT_ENG`. */ export declare function blendName(value: string | undefined): string | undefined; /** A stock event as the map writes it (`event:>A>B`, `event:/A/B`, or `A/B (a note)`) -> `event:/A/B`; else undefined. */ export declare function stockEvent(value: string | undefined): string | undefined; export declare function importVehicleAudio(opts: AudioImportOptions): AudioImportResult; /** A slot the real car physically lacks, from what the source says the car is fitted with. */ export declare function notFittedReason(slot: string, traits?: Inventory['traits']): string | undefined; export declare function formatAudioImport(result: AudioImportResult): string; export {};