Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
luciferous committed Jul 7, 2011
1 parent 7bf2560 commit 5d45752
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 `Beep`s.

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.

0 comments on commit 5d45752

Please sign in to comment.