Skip to content

amirbrooks/bleeps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

bleeps

Procedural 8-bit audio for arcade-style sound effects, generated in real time with the Web Audio API.

Install

npm install bleeps

Quick usage

import { ArcadeSounds } from "bleeps"

const arcade = new ArcadeSounds({ volume: 0.5 })

// Call init inside a user gesture (click/tap) to unlock audio
button.addEventListener("click", async () => {
  await arcade.init()
  arcade.shoot()
})

Custom sounds

import { Bleeps, DEFAULT_AUDIO_CONFIG } from "bleeps"

const config = {
  ...DEFAULT_AUDIO_CONFIG,
  MASTER_VOLUME: 0.3,
}

const bleeps = new Bleeps({ config })

await bleeps.init()
bleeps.play((audio) => audio.playCoin())

Exports

  • ArcadeSounds with shoot, explosion, hit, levelUp, step, ufo, powerUp, coin, gameOver
  • Bleeps core wrapper
  • AudioSystem low-level Web Audio engine
  • SimpleAudio tiny beep helper
  • DEFAULT_AUDIO_CONFIG and config types

License

MIT

About

๐Ÿ”Š Procedural 8-bit game audio. Zero dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors