Michael "Z" Goddard
97e2996090
add missing docs: SoundPlayer, AudioEngine, Effect.name
2018-06-22 14:43:37 -04:00
Michael "Z" Goddard
018d4fc01e
add AudioEngine.createEffectChain
2018-06-21 16:56:11 -04:00
Corey Frang
c8f3510713
Better order of stop/connect/play
2018-06-21 16:56:11 -04:00
Corey Frang
ea6093835c
mv GreenPlayer.js SoundPlayer.js
2018-06-21 16:56:11 -04:00
Corey Frang
45a7d1abef
rm AudioPlayer and SoundPlayer
2018-06-21 16:56:11 -04:00
Michael "Z" Goddard
c12a1a4766
comment SoundBank and EffectChain
2018-06-21 16:56:11 -04:00
Michael "Z" Goddard
7cef4e60a8
pass main EffectChain to SoundBank from Engine.createBank
2018-06-21 16:56:11 -04:00
Michael "Z" Goddard
5177dd5c85
add SoundPlayers to SoundBank
...
- SoundBank may not create SoundPlayers (but it can call .take if need)
- All SoundPlayers SoundBank plays are given to it
2018-06-21 16:56:11 -04:00
Michael "Z" Goddard
d40564d61a
make EffectChain standalone
...
- EffectChain knows of audioEngine so it can create Effects
- EffectChain connects to the target specified by .connect(target)
- EffectChain can connect to other Effects or EffectChains
- EffectChain can clone itself and connect to the original's target
- Add EffectChain.update to mirror Effects API
- Use deepest setting first in setEffectsFromTarget
2018-06-21 16:56:10 -04:00
Corey Frang
f5c219ceb3
First Draft SoundBank + EffectChain
2018-06-21 16:56:10 -04:00
Michael "Z" Goddard
ed0ef8e4dc
add docblock to AudioEngine.currentTime
2018-06-21 16:01:37 -04:00
Corey Frang
741817ad62
No need to set isPlaying here
2018-06-21 16:01:37 -04:00
Corey Frang
aa77d8d376
Add tests for play debounce
2018-06-21 16:01:37 -04:00
Corey Frang
e2da92fae7
cleanup tests a bit
2018-06-21 16:01:37 -04:00
Corey Frang
1d5d6bfbb2
Feedback from review fixes
2018-06-21 16:01:36 -04:00
Corey Frang
c62adcab3b
dispose taken sound player after it fades
2018-06-21 16:01:36 -04:00
Corey Frang
5b693f6708
move take to stop, play is always green / non effected until stopped
2018-06-21 16:01:36 -04:00
Corey Frang
18cb9787ae
wip: greenplayer tests
2018-06-21 16:01:35 -04:00
Michael "Z" Goddard
2126761dc3
use AudioContext.currentTime + DECAY_TIME to debounce sound start
...
Debounce when the sound starts to keep from playing many copies of the
same sound layered on itself. Use AudioEngine's currentTime in seconds
plus some value in milliseconds to make sure the sound has a chance to
start before starting a second playback.
2018-06-21 14:26:04 -04:00
Michael "Z" Goddard
331f083f5a
add GreenPlayer.isStarting promise
...
Self-resolving promise removes itself once it resolves. While it is on
a player the player may consider itself to not yet have the time to
actually start sound playback. While playback has not started, the
player can shortcut out of starting playback.
2018-06-18 14:47:38 -04:00
Michael "Z" Goddard
961749815c
feat: use GreenPlayer in AudioPlayer
2018-06-14 11:08:24 -04:00
Michael "Z" Goddard
46b7c6d37b
document GreenPlayer
2018-06-12 13:30:23 -04:00
Michael "Z" Goddard
90589b861d
fix: fix taking a SoundPlayer's state
2018-06-12 12:48:54 -04:00
Michael "Z" Goddard
5c822e6542
fix: listen to ended event to note playback stopping
...
- Fix playing a sound a second time once the first playback finished
2018-06-12 12:47:56 -04:00
Michael "Z" Goddard
a5702a7d49
add decodeSoundPlayer to AudioEngine
...
- decodeSoundPlayer returns a SoundPlayer instance instance of the
sound id
- Write deprecation notes in AudioEngine about audioBuffers
2018-06-11 16:16:14 -04:00
Michael "Z" Goddard
06a9af4dc3
implement new SoundPlayer
...
- Add GreenPlayer as SoundPlayer replacement
- Standalone playback separate from an AudioPlayer
- Each GreenPlayer has their own VolumeEffect for fading out
- play() while already isPlaying fades out the last copy
- stop() fades the sound out
- stopImmediate() hard stops the sound
2018-06-11 16:16:14 -04:00
Michael "Z" Goddard
16883f60f8
support null AudioPlayer in Effect
...
Support null AudioPlayer so Effect chains can be declared without it.
2018-06-11 16:16:13 -04:00
Michael "Z" Goddard
87f400b27d
set DECAY_TIME to 25ms
...
Use a DECAY_TIME that envelopes half of the lowest frequency a person
can hear.
2018-06-11 16:16:13 -04:00
Michael "Z" Goddard
0059ff53e1
start audio param transition at now
...
Explicitly start the param transitions at the audio context's now time.
2018-06-11 16:16:13 -04:00
Michael "Z" Goddard
841b029d7f
streamline connecting Effects
...
- Add sanity checks to connect
2018-06-08 12:39:30 -04:00
Michael "Z" Goddard
65702e7722
use VolumeEffect in AudioPlayer
2018-06-06 14:42:05 -04:00
Michael "Z" Goddard
1d9e530df2
add VolumeEffect
2018-06-06 14:40:21 -04:00
Michael "Z" Goddard
8a75061a19
fix Effect bugs
2018-06-06 14:38:26 -04:00
Michael "Z" Goddard
618239654f
fixup! extend existing effects from Effect
2018-06-05 14:42:46 -04:00
Michael "Z" Goddard
5b8f0fce65
fixup! extend existing effects from Effect
2018-06-05 13:59:53 -04:00
Michael "Z" Goddard
61e54b2457
extend existing effects from Effect
...
Add Effect class that manages connecting the effects in a chain from
their AudioPlayer to the AudioEngine.
2018-06-05 12:46:29 -04:00
Michael "Z" Goddard
d5b6290d45
break up index.js into files per class
...
- Add AudioEngine.js
- Add AudioPlayer.js
- Add Loudness.js
2018-06-04 18:11:44 -04:00
Karishma Chadha
8d67c6a4c3
Update variable name.
2018-04-17 09:36:21 -04:00
Karishma Chadha
a3ecd2ddc2
More refactoring/code-cleanup addressing PR comments.
2018-04-13 17:46:09 -04:00
Karishma Chadha
158adb0868
refactor decodeSound function, to only use sound data buffer to decode the sound instead of relying metadata from the project json
2018-04-13 11:40:34 -04:00
Eric Rosenbaum
84fdf5c76a
Merge pull request #70 from towerofnix/fix-firefox-loudness
...
Don't use mediaStream property, which is missing on Firefox
2018-01-16 15:39:58 -05:00
Eric Rosenbaum
d2b6cb40e3
Disconnect audio nodes on dispose
2018-01-09 18:18:49 -05:00
Florrie
3318b14457
Don't use mediaStream property
...
..which is missing on Firefox. Fixes #67 .
2018-01-04 08:31:09 -04:00
Eric Rosenbaum
734f976585
New name and value for DECAY_TIME
2017-12-20 15:17:26 -05:00
Eric Rosenbaum
1c8a545a8a
Set gain using setTargetAtTime
2017-12-20 12:07:53 -05:00
Paul Kaplan
dce5316551
Remove leftover references to adrum and note player
2017-11-22 09:55:02 -05:00
Eric Rosenbaum
b15312702e
Remove log
2017-11-21 10:50:59 -05:00
Eric Rosenbaum
730c57a976
Remove instruments and drums
2017-11-21 10:44:50 -05:00
Eric Rosenbaum
202d6d8b02
Add a function to get an AudioPlayer’s input node
2017-11-09 16:28:03 -05:00
Eric Rosenbaum
283049e514
Safely stop sounds in safari
2017-08-22 11:33:18 -04:00