audio

Audio playback utilities for managing sound effects and background music in web applications.

Functions

Function
Description
Example

play

Plays an audio file or removes all audio elements

dphelper.audio.play('notification.mp3', '/sounds/')

Description

Simple audio management for web applications:

  • Play Sound - Load and play audio files with optional looping

  • Stop All - Remove all dpHelper audio elements from the DOM

  • Multiple Sounds - Play different sounds simultaneously (each gets unique ID)

Usage Examples

Playing Sound Effects

// Play a simple notification sound
dphelper.audio.play('notification.mp3');

// Play with custom path
dphelper.audio.play('click.mp3', '/assets/sounds/');

// Loop background music
dphelper.audio.play('music.mp3', '/assets/audio/', true);

Stopping Audio

Complete Example

UI Sound Effects

Details

  • Author: Dario Passariello

  • Version: 0.0.2

  • Creation Date: 20240924

  • Last Modified: 20240924

  • Environment: Client-side only (browser)


Automatically generated document

Last updated