JSPM

silent-mp3-datauri

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q48458F
  • License MIT

a dummy 15ms silent MP3 as datauri

Package Exports

  • silent-mp3-datauri

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (silent-mp3-datauri) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

silent-mp3-datauri

stable

A 15 millisecond silent MP3 file generated by Audacity, and exported as a datauri string. This can be used for detecting autoplay behaviour in browsers.

Note: The 15 ms duration was decided through testing on Samsung Galaxy S6, which was not capable of handling smaller files in audioContext.decodeAudioData.

Install

npm install silent-mp3-datauri --save

Usage

The main export is a string, a datauri for the mp3.

var silence = require('silent-mp3-datauri')

var audio = new Audio()
audio.addEventListener('canplay', () => {
  console.log("Can play!")
})
audio.src = silence

License

MIT, see LICENSE.md for details.