@mog13/chime v0.0.2
Chime
Small JS library using the audio API for basic bleeps and bloops 🤖🎤
include in your HTML via script:
<script src="./path/to/chime.js"></script>
<script src="https://unpkg.com/@mog13/chime"></script>
PlayNote(frequency,duration,volume,type)
Plays a sound with the given frequency,volume, type for the duration.
frequency: int 0-MAX
duration: int 0-MAX - (seconds)
volume: float 0-1
type: "sine","square","triangle","sawtooth"
Defaults Defaults are used when not specified. You can change the defaults via Chime.defaultparameter
PlaySine(frequency,duration,volume)
Syntactic sugar for PlayNote
with the type set to "Sine"
PlaySquare(frequency,duration,volume)
Syntactic sugar for PlayNote
with the type set to "square"
PlayTriangle(frequency,duration,volume)
Syntactic sugar for PlayNote
with the type set to "triangle"
PlaySawtooth(frequency,duration,volume)
Syntactic sugar for PlayNote
with the type set to "sawtooth"
Dev
contributions welcome.
npm run build
to build