eo-typewriterjs / AudioManagerHelper
Class: AudioManagerHelper
Defined in: core/audio/helpers/audio-manager.helper.ts:206
Description
Runtime audio manager for the typing sound system.
Handles sfx pack resolution, sample selection strategies (shuffle-bag, round-robin, random), volume/playback-rate jitter, overlap control, and graceful no-op in non-browser environments.
Create one instance per typewriter and keep it alive for the session. All settings can be mutated at runtime without restarting playback.
Constructors
Constructor
new AudioManagerHelper(options?): AudioManagerHelper;Defined in: core/audio/helpers/audio-manager.helper.ts:216
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | TAudioOptions | Initial audio configuration. Defaults to enabled with master volume 1 and the built-in sfx pack. |
Returns
AudioManagerHelper
Description
Create a new AudioManagerHelper
Methods
ready()
ready(): Promise<void>;Defined in: core/audio/helpers/audio-manager.helper.ts:230
Returns
Promise<void>
A promise that resolves once playback can produce sound
Description
Wait until the samples needed by the current options are available. The built-in pack is loaded lazily the first time audio is enabled without custom sfxs; sounds requested before it has loaded are skipped.
setOptions()
setOptions(options): void;Defined in: core/audio/helpers/audio-manager.helper.ts:244
Parameters
| Parameter | Type | Description |
|---|---|---|
options | TAudioOptions | The new audio options to apply |
Returns
void
Description
Replace the full audio configuration. Resets internal channel selection state so the new sfxs and strategy take effect immediately on the next play call.
setEnabled()
setEnabled(enabled): void;Defined in: core/audio/helpers/audio-manager.helper.ts:256
Parameters
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Whether audio should be enabled |
Returns
void
Description
Enable or disable audio globally at runtime
setVolume()
setVolume(volume): void;Defined in: core/audio/helpers/audio-manager.helper.ts:267
Parameters
| Parameter | Type | Description |
|---|---|---|
volume | number | New master volume |
Returns
void
Description
Set the master volume. Clamped to [0, 1].
getOptions()
getOptions(): TAudioOptions;Defined in: core/audio/helpers/audio-manager.helper.ts:277
Returns
The current TAudioOptions
Description
Return a snapshot of the current audio options
playTyping()
playTyping(override?): void;Defined in: core/audio/helpers/audio-manager.helper.ts:289
Parameters
| Parameter | Type | Description |
|---|---|---|
override? | TAudioCommandOverride | Optional per-command audio override |
Returns
void
Description
Play a typing (insert) sound. Pass a per-command override to use a specific sfx or volume for this keystroke. Pass false to silence this specific keystroke regardless of global settings.
playDelete()
playDelete(override?): void;Defined in: core/audio/helpers/audio-manager.helper.ts:300
Parameters
| Parameter | Type | Description |
|---|---|---|
override? | TAudioCommandOverride | Optional per-command audio override |
Returns
void
Description
Play a delete sound: the typing samples, pitched lower by default. Pass false to silence this specific deletion regardless of global settings.
playMove()
playMove(override?): void;Defined in: core/audio/helpers/audio-manager.helper.ts:311
Parameters
| Parameter | Type | Description |
|---|---|---|
override? | TAudioCommandOverride | Optional per-command audio override |
Returns
void
Description
Play a cursor move sound: the typing samples, lighter and quieter by default. Pass false to silence this specific move regardless of global settings.