import { PlayerOptions, Player, ToneAudioNode, ReverbOptions, FeedbackDelayOptions, FreeverbOptions, DelayOptions, PingPongDelayOptions, GateOptions, AutoFilterOptions, BiquadFilterOptions, OnePoleFilterOptions, FeedbackCombFilterOptions, FilterOptions, ChorusOptions, PhaserOptions, TremoloOptions, VibratoOptions, CompressorOptions, MidSideCompressorOptions, MultibandCompressorOptions, LimiterOptions, GreaterThanOptions, GreaterThanZeroOptions, DistortionOptions, BitCrusherOptions, Panner3DOptions, AutoPannerOptions, StereoWidenerOptions } from 'tone'; interface MediaInterface extends Pick { /** * Whether the sound is currently paused. */ paused: boolean; /** * @deprecated Use {@link mute} instead. */ muted: boolean; /** * @deprecated Use {@link playbackRate} instead. */ speed: number; } interface MediaMemory extends Partial> { /** * The volume of this sound in the linear range [0, 1], where 0 is silence * and 1 is full volume. Stored and restored in linear form; converted * to/from Tone.js decibels internally. */ volume?: number; elapsed: number | undefined; paused: boolean; delay?: number; } interface SoundOptions extends Pick, "loop" | "autostart" | "fadeIn" | "fadeOut" | "mute" | "loopEnd" | "loopStart" | "reverse" | "playbackRate"> { /** * The volume of this sound in the linear range [0, 1], where 0 is silence * and 1 is full volume. This is converted to decibels internally before * being passed to the Tone.js Player. */ volume?: number; /** * A collection of audio filters/effects to apply to this sound. * * Install "tone" for the full list of available filters. * * @example * ```ts * import * as Tone from "tone"; * * const filters = [new Tone.FeedbackDelay("8n", 0.5)]; * ``` */ filters?: ToneAudioNode[]; /** * @deprecated Use {@link playbackRate} instead. */ speed?: number; /** * @deprecated Use {@link mute} instead. */ muted?: boolean; } interface SoundPlayOptions extends SoundOptions { /** * The delay in seconds before playback starts. If specified, playback is * scheduled to begin after the delay has elapsed rather than starting * immediately in a paused state. */ delay?: number; /** * The offset in seconds from the start of the sound at which to begin playback. */ elapsed?: number; } interface SoundPlayOptionsWithChannel extends SoundPlayOptions { /** * The alias of the audio channel to play the sound on. If the channel does * not exist it will be created automatically. * Defaults to `SoundManagerInterface.defaultChannelAlias` ("general"). */ channel?: string; } interface ChannelOptions extends Pick { /** * Whether this channel is a background channel. * Background channels are special: media playing on them is not stopped * when a scene changes, but continues in the background. */ background?: boolean; /** * The stereo pan position for this channel in the range [-1, 1]. * -1 is full left, 0 is centre, 1 is full right. * Defaults to 0. */ pan?: number; } type SoundFilterMemory = ({ filterType: "ReverbFilter"; } & Omit, "context">) | ({ filterType: "FeedbackDelayFilter"; } & Omit, "context">) | ({ filterType: "FreeverbFilter"; } & Omit, "context">) | ({ filterType: "DelayFilter"; } & Omit, "context">) | ({ filterType: "PingPongDelayFilter"; } & Omit, "context">) | ({ filterType: "GateFilter"; } & Omit, "context">) | ({ filterType: "AutoFilterFilter"; } & Omit, "context">) | ({ filterType: "BiquadFilterFilter"; } & Omit, "context">) | ({ filterType: "OnePoleFilterFilter"; } & Omit, "context" | "frequency">) | ({ filterType: "FeedbackCombFilterFilter"; } & Omit, "context">) | ({ filterType: "CustomFilter"; } & Omit, "context">) | ({ filterType: "ChorusFilter"; } & Omit, "context">) | ({ filterType: "PhaserFilter"; } & Omit, "context">) | ({ filterType: "TremoloFilter"; } & Omit, "context">) | ({ filterType: "VibratoFilter"; } & Omit, "context">) | ({ filterType: "CompressorFilter"; } & Omit, "context">) | ({ filterType: "MidSideCompressorFilter"; } & Omit, "context">) | ({ filterType: "MultibandCompressorFilter"; } & Omit, "context">) | ({ filterType: "LimiterFilter"; } & Omit, "context">) | ({ filterType: "GreaterThanFilter"; } & Omit, "context">) | ({ filterType: "GreaterThanZeroFilter"; } & Omit, "context">) | ({ filterType: "DistortionFilter"; } & Omit, "context">) | ({ filterType: "BitCrusherFilter"; } & Omit, "context">) | ({ filterType: "Panner3DFilter"; } & Omit, "context">) | ({ filterType: "AutoPannerFilter"; } & Omit, "context">) | ({ filterType: "StereoWidenerFilter"; } & Omit, "context">); interface ExportedSound { options: SoundOptions; filters?: SoundFilterMemory[]; } interface SoundPlay { stepIndex: number; paused: boolean; options?: SoundPlayOptions | string; } interface ExportedSoundPlay extends SoundPlay { sound: ExportedSound; } /** * Interface exported sounds */ interface SoundGameState { /** * @deprecated */ soundsPlaying?: { [key: string]: ExportedSoundPlay; }; mediaInstances: { [key: string]: { channelAlias: string; soundAlias: string; stepCounter: number; options: MediaMemory & { filters?: SoundFilterMemory[]; delay?: number; }; /** * @deprecated Use options.paused instead. */ paused?: boolean; }; }; } export type { ChannelOptions as C, ExportedSound as E, MediaInterface as M, SoundGameState as S, SoundPlayOptions as a, SoundPlayOptionsWithChannel as b, MediaMemory as c, ExportedSoundPlay as d, SoundOptions as e, SoundPlay as f };