🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

apu

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apu

Easy 3 kB library for 98% accurate Gameboy audio

0.2.32
latest
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created

APU

Want some hardware-accurate Gameboy music and sounds in your HTML5 game or app? Don't want to load megabytes of .mp3 files? Overwhelmed or frustrated by the Web Audio API? Welcome to apu!

Features

  • Tiny; single file, about 9 kB (gzip)
  • Supports playing .vgm files (which are typically a few kB after gzip)
  • Mute BGM channels while playing SFX
  • Highly performant
    • Fast sample generation in WebAssembly
    • When possible, uses AudioWorklet to run completely outside the main thread (works in latest Chrome and FireFox)
  • ES module
  • TypeScript bindings

Browser support

Latest Chrome, Safari, Firefox

Developing

To develop this project you'll need:

  • Unix system (MacOS and Ubuntu definitely work)
  • Node 12+ (older versions may work but untested)
  • Make
  • Clang
  • LLVM 8+ (should include wasm-ld; or, on Ubuntu 20.04, wasm-ld-10)
  • Binaryen (should include wasm-opt)

To build it:

make

To watch & rebuild:

npm run watch

To watch, rebuild, and run a live-updating web server:

npm start

Troubleshooting:

  • On Mac, when installing llvm through Brew, you might find that wasm-ld is still not available. Try brew link --force llvm

Acknowledgments

The high-performance WebAssembly bundle for emulating the GameBoy's APU is compiled from C code that was adapted from an old version of VGMPlay, which was written by Anthony Kruize in 2002. Without that code, this module would not be nearly as performant nor as accurate as it is today.

License

BSD 3-Clause

FAQs

Package last updated on 30 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts