Skip to content

mog13/chime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.default[parameter]

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

About

Small JS library using the audio API for basic bleeps and bloops πŸ€–πŸŽ€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published