API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMusicFactory
AssetFactory implementation that loads streaming audio assets (MP3, OGG, WAV, AAC, and other browser-supported formats) and produces a Music instance backed by an `<audio>` element. Unlike SoundFactory, music assets are decoded lazily via the browser's streaming audio pipeline rather than being fully decoded into an AudioBuffer up-front, making them appropriate for long-form background tracks. The underlying `<audio>` elements are paused and detached when MusicFactory.destroy is called.
import { MusicFactory } from '@codexo/exojs' AssetFactory implementation that loads streaming audio assets (MP3, OGG, WAV, AAC, and other browser-supported formats) and produces a Music instance backed by an `\<audio>` element.
Unlike SoundFactory, music assets are decoded lazily via the browser's streaming audio pipeline rather than being fully decoded into an AudioBuffer up-front, making them appropriate for long-form background tracks. The underlying `\<audio>` elements are paused and detached when MusicFactory.destroy is called.
new(): MusicFactory create(source: ArrayBuffer, options: MusicFactoryOptions): Promise<Music> createObjectUrl(blob: Blob): string destroy(): void process(response: Response): Promise<ArrayBuffer> revokeObjectUrl(objectUrl: string): void storageName: "music"