nodepat

A NodeJS library that makes playing audio simple.

Usage no npm install needed!

<script type="module">
  import nodepat from 'https://cdn.skypack.dev/nodepat';
</script>

README

nodepat

npm cicd

nodepat is a NodeJS library that makes playing audio simple. nodepat uses FFmpeg to provide robust support for virtually any audio format and SDL2 to play back audio.

Prerequisites

Install Prerequisites before installing.

Install

npm install nodepat

Example

import nodepat from 'nodepat';

// Alternatively
import { play, skip, pause, resume } from 'nodepat';

(async () => {
  // Play a file
  await nodepat.play('amerika.mpga');

  // Skip the current file
  await nodepat.skip();

  // Pause audio playback
  await nodepat.pause();

  // Resume audio playback
  await nodepat.resume();
})();