Audio playback library for Deno.
import { play, pause, setVolume } from "https://deno.land/x/[email protected]/mod.ts";
// supports mp3, wav, vorbis, flac
// play music.mp3 with 3/4 of the full volume
const idx = play("music.mp3", 0.75);
setTimeout(() => {
// increase the volume after 1.5s
setVolume(idx, 1);
}, 1500);
setTimeout(() => {
// pause the track after 3s
pause(idx);
}, 3000);$ cargo b --release$ deno run --unstable -A example.tsPull request, issues and feedback are very welcome. Code style is formatted with
deno fmt and commit messages are done following
Conventional Commits spec.
Logo by @carazmatic at picsart.com (cute, isn't it?)
deno_audio is licensed under the MIT license. Please see the LICENSE file.