Assets and sound
Declare package-relative assets in manifest.json. They are validated and
decoded before the entry module evaluates, so first use does not stall a
frame.
import { assets } from "fumo:assets";
import { sound } from "fumo:sound";
const settings = assets.loadJson("data/settings.json");
const text = assets.loadText("data/message.txt");
const marker = assets.loadTexture("images/marker.png");
const notify = sound.load("sounds/notify.wav");
Supported resources:
- PNG, JPEG, WebP when a Windows WIC WebP codec is available, and BMP
- PCM, float, and extensible WAV
- JSON and text-like files
Textures produce stable package-owned handles. GPU views are created lazily,
released on device loss, and recreated from the decoded cache. Sounds are
played from cached memory with sound.play(handle).
Assets are size- and dimension-limited, canonicalized inside the package, and removed when the package unloads. A package cannot use another package’s handle.