simplayer-promise

Promisfy simple multi platform sound player

Usage no npm install needed!

<script type="module">
  import simplayerPromise from 'https://cdn.skypack.dev/simplayer-promise';
</script>

README


About

This is simple multi platform sound player. I get ideas from opener.

This module should be used when to play simple sound or sound effect. Not suitable for music players.

Installation

npm install simplayer-promise --save

If platform is linux, then need to install the alsa

# before we start the work, please update
sudo apt-get update
sudo apt-get upgrade

# install ALSA
sudo apt-get install alsa-base alsa-utils

Usage

simplayer-promise function return Promise instance.


var play = require('simplayer-promise');

play('/path/to/sound.mp3')
  .then(() => {
    // something
  })
  .catch(() => {
    // reject
  });

Author

  • Maxmellon

LICENSE

MIT