Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

howler

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

howler

Javascript audio library for the modern web.

  • 2.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
418K
decreased by-2.82%
Maintainers
1
Weekly downloads
 
Created

What is howler?

Howler.js is a JavaScript audio library for the modern web. It provides a simple API for playing and controlling audio files, supporting a wide range of audio formats and offering features like spatial audio, audio sprites, and more.

What are howler's main functionalities?

Basic Audio Playback

This feature allows you to play audio files with a simple API. You can specify the source of the audio file and control playback with methods like play, pause, and stop.

const sound = new Howl({
  src: ['sound.mp3']
});

sound.play();

Audio Sprites

Audio sprites allow you to combine multiple audio files into a single file and play specific sections of it. This can be useful for reducing the number of HTTP requests and managing audio assets more efficiently.

const sound = new Howl({
  src: ['soundsprite.mp3'],
  sprite: {
    blast: [0, 1000],
    laser: [2000, 3000]
  }
});

sound.play('blast');

Spatial Audio

Spatial audio allows you to position audio in 3D space, providing a more immersive experience. You can set the position of the sound source and control its volume and other properties.

const sound = new Howl({
  src: ['sound.mp3'],
  pos: [0, 0, -0.5],
  volume: 1.0
});

sound.play();

Event Handling

Howler.js provides an event system that allows you to listen for various events such as load, play, pause, and stop. This can be useful for synchronizing audio with other parts of your application.

const sound = new Howl({
  src: ['sound.mp3']
});

sound.on('load', function() {
  console.log('Sound loaded!');
});

sound.play();

Other packages similar to howler

Keywords

FAQs

Package last updated on 24 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc