clicktone

1.2.0 • Public • Published

clicktone

npm GitHub package version NPM Downloads

A simple class that provides a convenient abstraction for handling
audio playback by web applications, with support for iOS devices.

Demo


Install

yarn add clicktone

Import

import ClickTone from 'clicktone';

Usage

Class uses the Web Audio API, which supports many audio file formats: MP3, WAV, OGG, AAC and others. Please note that not all browsers support these formats.

const click = new ClickTone({
  file: './sound.mp3',
  volume: 0.7,
  throttle: 400,
  callback: () => { console.log('Playback ended') },
  debug: true,
});

myButton.addEventListener('click', () => click.play());

License

clicktone is released under MIT license.

Package Sidebar

Install

npm i clicktone

Weekly Downloads

5

Version

1.2.0

License

MIT

Unpacked Size

26.5 kB

Total Files

9

Last publish

Collaborators

  • ux-ui