Creates an instance of AudioService. Initializes the Web Audio API context, compressor, and audio palette. Subscribes to settings changes for volume and frequency range updates.
Service for displaying audio mode notifications to users
Service providing user preferences for volume and frequency range
Initial plot state used to configure audio mode
Disposes of all audio resources and cleans up the service. Stops all active audio, disposes the audio palette, disconnects the compressor, and closes the AudioContext.
Observer callback invoked when plot state changes. Plays appropriate audio based on the current data point, including:
The updated plot state containing audio parameters
Plays a warning tone to indicate navigation boundary or invalid state. Consists of two descending beeps (half-step down) to clearly signal a warning.
Plays a warning tone only if audio mode is enabled. Use this for conditional warnings that should respect user's audio preferences.
Plays a repeating waiting tone to indicate an ongoing async operation. The tone repeats every second until stopped.
AudioId that can be passed to stop() to cancel the waiting tone
Plays a completion tone to indicate an async operation has finished. Uses a higher frequency than the waiting tone for clear distinction.
AudioId for the played tone
Toggles the audio mode between off, separate, and combined states. Cycles through modes and notifies the user of the current state.
Stops one or more active audio tones by their IDs. Disconnects oscillators and clears associated timeouts/intervals.
Single AudioId or array of AudioIds to stop
Service responsible for audio sonification of plot data. Implements the Observer pattern to receive state updates from plot models and converts data values to audio frequencies with spatial panning.
Features: