Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Makes browser beep.
JavaScript
branch: master
Failed to load latest commit information.
README.md
beep.js Fix configurable namespacing
beepjs.jpg Add Bee PJs

README.md

Make your browser beep

Step 1. Include beep.js

<script type="text/javascript" src="beep.js"></script>

Step 2. Beep!

<script type="text/javascript">
    new Beep(22050).play(1000, 1, [Beep.utils.amplify(8000)]);
</script>

Step 3. That's all!

Nothing here.

API

Read the source for more detail.

Constructor

new Beep(number:samplingrate) -> Beep

Makes Beeps.

Methods

#generate(number:samplingrate) -> [number:sample]

Generates a list of numbers representing samples of the sine wave.

#encode(number:frequency, number:duration, [function:filters]) -> string:wavencode

Repeats the sine samples to fulfill a specified duration and encodes them to a WAV format.

#play(number:frequency, number:duration, [function:filters])

Generates and encodes a sine wave and tries to play it with the <audio> element.

Something went wrong with that request. Please try again.