Commit graph

8 commits

Author SHA1 Message Date
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
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
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