Commit graph

1102 commits

Author SHA1 Message Date
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
2bd946423b
remove rest of async/await in tests 2018-06-21 16:01:37 -04:00
Corey Frang
cdd35b5296
convert async/await to promise chain 2018-06-21 16:01:36 -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
7f2b9786ee
Fix broken tests (mock change for effects and plan audioengine) 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
2c4edf288f
update test to work with new isPlaying problem 2018-06-21 16:01:36 -04:00
Corey Frang
8110885a62
add a play while playing test 2018-06-21 16:01:36 -04:00
Corey Frang
18cb9787ae
wip: greenplayer tests 2018-06-21 16:01:35 -04:00
Eric Rosenbaum
7dd6d557bb
Merge pull request #89 from LLK/green-audio-player
Green audio player
2018-06-21 15:37:55 -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
Andrew Sliwinski
094face1be
Update TRADEMARK 2018-06-18 13:12:40 -04:00
Ray Schamp
2ea0867df8
Merge pull request #91 from rschamp/travis-stages
Don't use npm prepublish
2018-06-14 13:58:44 -04:00
Ray Schamp
4e67a0548c Don't use npm prepublish
Be explicit and build on the release step. This way it doesn't matter which version of npm we use (since prepublish is deprecated in npm 5). Also because we don't actually need to build to use scratch-audio in scratch-gui, so it doesn't help to run build on npm install anyway.
2018-06-14 13:57:36 -04:00
Ray Schamp
75a32bf7fd
Merge pull request #90 from rschamp/travis-stages
Release with build stages
2018-06-14 13:51:21 -04:00
Ray Schamp
110c07594d Release with build stages
Also update to Node 8, and specify the stable 8 for build/lint/release, rather than latest stable Node, so less stuff changes.
2018-06-14 13:50:00 -04:00
Michael "Z" Goddard
961749815c
feat: use GreenPlayer in AudioPlayer 2018-06-14 11:08:24 -04:00
Eric Rosenbaum
2a63b0b027
Merge pull request #88 from mzgoddard/green-player
Green SoundPlayer
2018-06-12 16:20:26 -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
Ray Schamp
224fdeedf1
Merge pull request #86 from mzgoddard/test-for-effect
Test for effect
2018-06-11 13:11:17 -04:00
Michael "Z" Goddard
f6d5353e83
split travis testing into lint, tap, build tasks 2018-06-08 12:39:30 -04:00
Michael "Z" Goddard
26e972a62d
add tap script to package.json 2018-06-08 12:39:30 -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
e40e6e0b1b
add Effect tests and mocks 2018-06-08 12:39:29 -04:00
Eric Rosenbaum
6c8edf52b9
Merge pull request #85 from mzgoddard/volume-effect
add and use VolumeEffect in AudioPlayer
2018-06-07 13:53:26 -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
Eric Rosenbaum
2f05e45a6d
Merge pull request #84 from mzgoddard/effects-same-api
extend existing effects from Effect
2018-06-05 17:05:22 -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
Eric Rosenbaum
220483119b
Merge pull request #83 from mzgoddard/break-up-index
break up index.js into files per class
2018-06-05 10:56:36 -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
Ray Schamp
c40105cf07
Merge pull request #81 from mzgoddard/dependents-no-boiler
Use src/index for browser entry point
2018-05-31 17:46:55 -04:00
Ray Schamp
33fba91bcb
Merge pull request #80 from mzgoddard/babel-preset-env
Replace babel-preset-es2015 with babel-preset-env
2018-05-08 16:50:03 -04:00
Michael "Z" Goddard
ee5aafc862 Replace babel-preset-es2015 with babel-preset-env 2018-05-08 16:49:24 -04:00
Ray Schamp
a9182ab10e
Merge pull request #79 from mzgoddard/webpack-4
Update to webpack 4
2018-05-08 12:58:07 -04:00
Michael "Z" Goddard
d5d6ab9eb8
Depend on script dependencies for downstream webpack
Downstream webpack will need any dependencies src/ depends on so it can
successfully build. Also if multiple packages being built into a larger
script share a common dependency version range, they can share the
dependency instead of duplicating it. This will save built file size,
execution time, and memory.
2018-05-08 11:13:05 -04:00
Michael "Z" Goddard
df13e181eb
Update to webpack 4 2018-05-07 12:41:19 -04:00