Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Update README start method documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danigb committed Aug 9, 2016
1 parent eab0ae2 commit 79d5c0c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Soundfont.instrument(ac, 'clavinet').then(function (clavinet) {
// or stop only one
clavinet.play('C4').stop(ac.currentTime + 0.5)
// or pass a duration argument to `play`
clavinet.play('C4', ac.currentTime, 0.5)
clavinet.play('C4', ac.currentTime, { duration: 0.5})


// You can connect the instrument to a midi input:
Expand Down Expand Up @@ -160,6 +160,17 @@ An alias for `player.start`
#### player.start(name, when, options) ⇒ <code>AudioNode</code>
Start a sample buffer. The returned object has a function `stop(when)` to stop the sound.

Valid options are:

- `gain`: float between 0 to 1
- `attack`: the attack time of the amplitude envelope
- `decay`: the decay time of the amplitude envelope
- `sustain`: the sustain gain value of the amplitude envelope
- `release`: the release time of the amplitude envelope
- `adsr`: an array of `[attack, decay, sustain, release]`. Overrides other parameters.
- `duration`: set the playing duration in seconds of the buffer(s)
- `loop`: set to true to loop the audio buffer

<a name="player.stop"></a>
#### player.stop(when, nodes) ⇒ <code>Array</code>
Stop some or all samples
Expand Down

0 comments on commit 79d5c0c

Please sign in to comment.