INNER CODE UNIT · TypeScript
loadMusic
Bloom-Engine/engine · src/audio/index.ts:56
export function loadMusic(path: string): Music {
const handle = bloom_load_music(path as any);
return { handle };
}
/// Returns the raw numeric handle. Prefer this on Android (aarch64): Perry 0.5.x
/// miscompiles `music.handle` field reads that feed straight into an f64 FFI slot,
/// producing NaN and dropping the music.
export function loadMusicRaw(path: string): number {
return bloom_load_music(path as any);
}
export function playMusic(music: Music): void {
bloom_play_music(music.handle);
}
/**
* @internal Compiler workaround — not part of the public API.