import type { SoundToken } from "./soundToken"; import type { Channel } from "./channel"; export interface SoundOptions { /** * The volume of the sound context. * @default 1 * @range [0, 1] */ volume?: number; /** * The latency hint of the sound context. * @default "interactive" * @enum ["balanced", "interactive", "playback"] */ latencyHint?: "balanced" | "interactive" | "playback"; /** * The sample rate of the sound context. * @default 44100 * @range [1, Infinity] */ sampleRate?: number; /** * The maximum number of channels that can be created. This includes the master channel and all the sub-channels. * If the maximum number of channels is reached, creating a new channel will throw an error. * @default 128 * @range [1, Infinity] */ maxChannels?: number; /** * Whether to silence non-critical warnings (such as best-effort disconnect/stop failures). * @default false */ silent?: boolean; } export interface ChannelOptions { /** * The volume of the channel. * @default 1 * @range [0, 1] */ volume?: number; /** * The limit of the number of tokens that can play at the same time. * @default Infinity * @range [1, Infinity] */ limit?: number; } export interface PlayOptions { /** * The volume of the token. * @default 1 * @range [0, 1] */ volume?: number; /** * The start time of the token. The token will start playing from the start time. * @default 0 * @range [0, Infinity] */ startTime?: number; /** * The end time of the token. When the token reaches the end time, it will be stopped automatically. * When the `loop` option is true, the token will loop back to the start time. * @default Infinity * @range (startTime, Infinity] */ endTime?: number; /** * The rate of the token. * @default 1 * @range (0, Infinity] */ rate?: number; /** * Specify the loading mode. * @default "auto" * @enum ["stream", "full", "auto"] * - "stream": Use `