79339050

Date: 2025-01-08 12:01:19
Score: 0.5
Natty:
Report link

MixPlayer (https://www.npmjs.com/package/mix-player) is your solution! It supports most of the common file formats (FLAC, MP3, Ogg, VOC, and WAV files) and has customizability of fade-ins, volume changing, seeking, looping, etc.

Heres an example snippet:

import { MixPlayer } from "MixPlayer";

MixPlayer.play("test_audio.mp3");

MixPlayer.onAudioEnd(() => {
  console.log("Audio ended! Now what?");
});

await MixPlayer.wait();

process.exit(0);

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: 10xNerd