0.0.2 • Published 5 years ago

@mog13/chime v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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