Skip to content

AndCake/deno_audio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


deno_audio logo

deno_audio

Audio playback library for Deno.

stars issues deno version

Example

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);

Building from source

Prerequisites

  • deno
  • rust
  • libasound2-dev - apt-get install libasound2-dev

Building

$ cargo b --release

Example

$ deno run --unstable -A example.ts

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

Copyright

Logo by @carazmatic at picsart.com (cute, isn't it?)

deno_audio is licensed under the MIT license. Please see the LICENSE file.

About

Audio playback library for Deno

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 50.5%
  • Rust 49.5%