Commit graph

817 commits

Author SHA1 Message Date
Richard Davey
8e82489a13
Merge pull request #5949 from jcyuan/iOS10fix
fix iOS10 webkitAudioContext failed to initialize
2022-02-03 16:46:46 +00:00
Richard Davey
b69889fbc2 Can at least use the body reference to save some space #5948 2022-02-03 16:23:40 +00:00
J.C
214cdf6c1c on iOS 10, the webkitAudioContext does not have a parameter, it will cause error if you pass one. 2021-12-21 17:26:29 +08:00
J.C
57dee7c461 1, add missing polyfill for IE9,10
2, IE9, 10, function alias causes error and all audio can't work properly
2021-12-21 17:09:55 +08:00
Richard Davey
1af06910e2 Moved unlock handling to base, tidying up the common code 2021-11-22 23:54:12 +00:00
Richard Davey
a51267419d Use cache reference, more concise error 2021-11-22 23:53:56 +00:00
Richard Davey
5456267b2a Added pendingUnlock, tidied up the events, added unlock method 2021-11-22 23:53:44 +00:00
Richard Davey
2b6afda684 New unlock handler 2021-11-22 18:35:43 +00:00
Richard Davey
9705ea5b70 Debugging audio 2021-11-22 18:35:36 +00:00
Richard Davey
6c6084a4c5 Debugging logs 2021-11-22 16:59:30 +00:00
Richard Davey
e65b77a2f7 Only emit unlocked if actually unlocking 2021-11-09 18:38:37 +00:00
Richard Davey
93c182f8f9 Renamed method to decodeAudioQueue 2021-11-09 00:05:30 +00:00
Richard Davey
b538f77b26 Added decodeOnDemand boolean 2021-11-08 22:17:34 +00:00
Richard Davey
ef711f1444 Drop the iife 2021-11-08 21:55:08 +00:00
Richard Davey
b4a7dab08b Drop the iife 2021-11-08 21:51:33 +00:00
Richard Davey
3e45e6af38 Update WebAudioSoundManager.js 2021-11-08 18:26:06 +00:00
Richard Davey
46b9db5aca Added jsdocs, removed debug calls, added decoding flag 2021-11-08 18:01:50 +00:00
Richard Davey
86b26eff8d Added jsdocs, removed debug tests, fixed pending playback 2021-11-08 18:01:23 +00:00
Richard Davey
aaed099c0a Create WebAudioDecodeEntry.js 2021-11-08 18:01:03 +00:00
Richard Davey
78c141c84e Removed unlock handler from main loop 2021-11-08 18:00:54 +00:00
Richard Davey
18b9643d8f Return all sound types. Fix #5578 2021-11-08 16:04:11 +00:00
Richard Davey
1deb04bcee Documented all of the NoAudio properties and methods #5578 2021-11-08 15:51:56 +00:00
Richard Davey
a2956176dd New unlocking and decode queue code 2021-11-05 00:27:26 +00:00
Richard Davey
4f1f5ede9c Postponed all audio buffer creation until context is ready 2021-11-05 00:27:13 +00:00
Richard Davey
63fd3b92cd Expose new DECODED_KEY event 2021-11-05 00:26:57 +00:00
Richard Davey
313d2e8936 Create DECODED_KEY_EVENT.js 2021-11-05 00:26:30 +00:00
Richard Davey
4d6c67c22e Working through removing audio decoding from the loader 2021-11-04 17:54:43 +00:00
Richard Davey
040730defe Update WebAudioSoundManager.js 2021-03-26 11:24:56 +00:00
Richard Davey
d3d73d4c09 Update WebAudioSoundManager.js 2021-03-26 10:05:47 +00:00
Richard Davey
e5f4548961 The WebAudioSoundManager.onFocus method will now test to see if the state of the AudioContext is interrupted, as happens on iOS when leaving the page, and then resumes the context. Fix #5390 #5156 #4790 2021-03-24 17:37:40 +00:00
Richard Davey
23987112e1 Update WebAudioSound.js
* The `WebAudioSound.audioBuffer` property is no longer private.
* The `WebAudioSound.source` property is no longer private.
* The `WebAudioSound.loopSource` property is no longer private.
* The `WebAudioSound.muteNode` property is no longer private.
* The `WebAudioSound.volumeNode` property is no longer private.
* The `WebAudioSound.pannerNode` property is no longer private.
* The `WebAudioSound.hasEnded` property is no longer private, but _is_ read only.
* The `WebAudioSound.hasLooped` property is no longer private, but _is_ read only.
2021-02-01 15:17:48 +00:00
Richard Davey
c20b06b259 Made most properties public. Fix #5531
* The `WebAudioSoundManager.createAudioContext` method is no longer private.
* The `WebAudioSoundManager.context` property is no longer private.
* The `WebAudioSoundManager.masterMuteNode` property is no longer private.
* The `WebAudioSoundManager.masterVolumeNode` property is no longer private.
* The `WebAudioSoundManager.destination` property is no longer private.
2021-02-01 15:17:37 +00:00
Richard Davey
ceac5bdd4a Lint fix. 2021-01-06 11:07:14 +00:00
jdcook
b935c5bf03 added null check for WebAudio pannerNode 2021-01-05 16:37:24 -06:00
Richard Davey
afda0febcd The new Web Audio Panning feature breaks WebAudio on Safari (OSX and iOS). The stero panner node is now only created if supported. Fix #5460 2020-12-21 13:28:22 +00:00
Richard Davey
2a49b4aa80 The WebAudioSoundManager will no longer try to unlock itself if the Game hasn't already booted and been added to the DOM. It will now wait for the BOOT event and unlock based on that. Fix #5439 2020-12-14 10:37:00 +00:00
Richard Davey
33253a7469 Fixed version numbers and JSDocs. #5274 2020-12-14 10:11:30 +00:00
Richard Davey
dde5b250e3
Merge pull request #5274 from pi-kei/sound-panning
Add ability to pan sounds
2020-12-14 10:00:33 +00:00
samme
ae5182be7d Default Phaser.Core.Config#audio; and refactor 2020-09-10 09:22:44 -07:00
Pavel Kabakin
385c005c42 Fix Events 2020-08-26 04:28:18 +03:00
Pavel Kabakin
7c74b77fc0 Add ability to pan sounds 2020-08-26 04:15:51 +03:00
samme
36f08e75b8 Fix error for missing audio tag (already released) 2020-05-21 16:40:50 -07:00
Richard Davey
a03b6e6592 Lint fixes 2020-04-27 12:59:28 +01:00
Richard Davey
46a42f1440 Fix blur / focus event issue (re: #5013) 2020-04-27 11:13:54 +01:00
Richard Davey
1dd3d4e372
Merge pull request #5055 from samme/fix/html5audio-volume
Clamp audio tag volume in HTML5AudioSound
2020-04-27 10:08:55 +01:00
Richard Davey
3149cd6bcc
Merge pull request #5095 from samme/feature/new-soundmanager-methods
Add new Sound Manager methods
2020-04-27 10:07:14 +01:00
samme
1a27ff9c04 Docs: NoAudioSound
Does not extend BaseSound, strictly speaking
2020-04-22 10:37:21 -07:00
samme
a9adf0f6cf Fix NoAudioSound#destroy 2020-04-22 10:36:42 -07:00
samme
9909ada001 Add NoAudioSound methods 2020-04-22 09:35:57 -07:00
samme
e8381c1b9b Add new Sound Manager methods
- BaseSoundManager#get()
- BaseSoundManager#getAll()
- BaseSoundManager#removeAll()
- BaseSoundManager#stopByKey()
2020-04-04 14:29:31 -07:00
samme
51ecad61ad Clamp volume
Fixes 'IndexSizeError: The index is not in the allowed range'
2020-03-24 17:00:25 -07:00
samme
cae9d2ec07 Description for BaseSoundManager#playAudioSprite 2020-03-24 13:56:22 -07:00
Chris Andrew
8655dfa6c9
WebAudioSoundManager description spacing 2020-03-17 21:22:40 +00:00
Chris Andrew
3fb803568d
HTML5AudioSoundManager description spacing 2020-03-17 21:21:13 +00:00
samme
677cfae424 Docs for Sound Managers 2020-02-20 09:10:25 -08:00
Richard Davey
ff65e69cd1 Changed copyright date to 2020 2020-01-15 12:07:09 +00:00
Richard Davey
3d144bd99e JSDoc update. Fix #4955 2020-01-15 10:29:09 +00:00
samme
974ffd93ee Docs for Phaser.Sound.BaseSoundManager#play
Always adds a new sound
2020-01-03 13:44:07 -08:00
samme
56cd59c537 Throw error for a bad audio asset key 2019-12-23 09:46:45 -08:00
Richard Davey
5e1d86b75b WebAudioSoundManager.setAudioContext is a new method that allows you to set the Sound Manager Audio Context to a different context instance. It will also disconnect and re-create the gain nodes on the new context. 2019-11-20 14:50:28 +00:00
Richard Davey
77ca0d0bbd The WebAudioSoundManager.unlock method will now listen for keydown events in order to unlock the Audio Context, as well as touch and pointer events, making it more accessible 2019-11-20 13:50:55 +00:00
Richard Davey
620ce8556f Update GLOBAL_MUTE_EVENT.js 2019-10-10 23:50:55 +01:00
Richard Davey
59cdc1fef0 Update WebAudioSoundManager.js 2019-10-04 13:14:11 +01:00
Richard Davey
7063085120 Updated jsdocs. Fix #4200 2019-10-02 13:21:51 +01:00
Richard Davey
89c30fe42f BaseSoundManager.forEachActiveSound will now only invoke the callback if the sound actually exists and isn't pending removal. Fix #3383 2019-10-02 12:50:10 +01:00
Richard Davey
5dbfbae5f9 Updated jsdoc types. Fix #4308 2019-10-01 17:04:06 +01:00
Richard Davey
2829d27e8a Fixed return type. Fix #4772 2019-09-30 13:32:14 +01:00
Richard Davey
e710bec68b The WebAudioSoundManager will now remove the document touch handlers even if the Promise fails, preventing it from throwing a rejection handler error. 2019-07-17 14:35:10 +01:00
Richard Davey
dfdba323fb New decodeAudio method for decoding base64 audio into webaudio 2019-06-11 14:31:43 +01:00
Richard Davey
a124580930 New Audio Decode type 2019-06-11 14:31:17 +01:00
Richard Davey
f2c2c93499 Added new DECODE and DECODE_ALL events 2019-06-11 14:29:29 +01:00
Richard Davey
c91ed91ce3 License link update 2019-05-10 16:15:04 +01:00
Richard Davey
a6341a97a8 Fixed Types references 2019-05-09 15:32:53 +01:00
Richard Davey
dc18d06f10 Sound Types 2019-05-09 12:38:12 +01:00
Richard Davey
0db663d901 More typedefs 2019-02-13 15:38:50 +00:00
Richard Davey
ccaae460a4 Added jsdoc version numbers to each event 2019-02-12 11:37:58 +00:00
Richard Davey
ba381f8e3d Don't create a promise unless the context exists 2019-02-04 23:29:39 +00:00
Richard Davey
eb9ed3463f Lots of namespace and jsdoc fixes 2019-02-01 18:02:58 +00:00
Richard Davey
1eccff1e3b Fixed jsdoc links and markdown bullet lists 2019-01-18 15:20:56 +00:00
Richard Davey
44cff816ba Added all the Sound Events. 2019-01-17 17:20:54 +00:00
Richard Davey
aa341854c7 Happy New Year 2019-01-15 16:20:22 +00:00
Richard Davey
10878f9c7b Formatting fix 2018-11-20 10:33:07 +00:00
Richard Davey
f0039678f9
Merge pull request #4151 from Waclaw-I/HTML5AudioSound-fixes
Setting HTML5AudioSound's volume and mute is now working.
2018-11-20 10:28:09 +00:00
Richard Davey
476a31093a onFocus and onBlur ignore if locked 2018-11-13 19:47:47 +00:00
Piotr 'Waclaw I' Hanusiak
361708a22b Setting HTML5AudioSound's volume and mute is now working. 2018-11-07 19:08:48 +01:00
Richard Davey
4b1c762296 Updated @memberOf to @memberof 2018-10-10 10:49:13 +01:00
Richard Davey
a9063604dc Replace @readOnly with @readonly 2018-10-09 13:40:00 +01:00
Chris Andrew
5f3767f43d Polished some DataManagerPlugin and EachActiveSoundCallback descriptions. 2018-05-23 08:18:49 +01:00
Chris Andrew
f95b35eae7 Finished off descriptions for Data, Plugins and Sound. 2018-05-23 08:09:24 +01:00
Richard Davey
d595da49fd Now use the prestep event to update instead 2018-05-11 01:50:02 +01:00
Richard Davey
39cf7252c9 Check if body exists. Fix #3649. 2018-05-09 13:45:47 +01:00
Richard Davey
ec3bd4c729 The WebAudioSoundManager will now listen for 'click' events on the document body, as well as touch events, before resuming the AudioContext. 2018-05-08 16:51:43 +01:00
Richard Davey
1afb066dfa Docs 2018-05-04 11:33:56 +01:00
Richard Davey
a09c8576d5 Shorter error 2018-05-04 02:38:09 +01:00
Richard Davey
d780cda233 Audio Sprites now support loop property 2018-05-04 02:38:01 +01:00
Richard Davey
669792d3ce Tidying up 2018-05-03 17:12:19 +01:00
Pavle Goloskokovic
116e62fafe Setting locked lag only if there are locked audio tags 2018-04-21 20:09:18 +02:00
Pavle Goloskokovic
eec19e146a Removing locked actions from queue before performing it 2018-04-21 20:08:25 +02:00
Pavle Goloskokovic
923ac40d65 No need for resetting lockedActionsQueue 2018-04-21 20:06:14 +02:00
Pavle Goloskokovic
53b69f036c Removed assigning lockedActionsQueue to empty array since it is initialized in constructor 2018-04-21 20:02:48 +02:00