FIXED
Fatal error in Chrome for iOS (#1491).
The README has been updated with more examples and various clarifications. PRs/issues with suggestions for further improvements are appreciated.
CHANGED
Includekeydown
event when unlocking audio (#1417).CHANGED
The audio state is changed toloading
while the player is buffering (#1444).FIXED
Looping sounds wouldn't always work correctly in recent versions of Firefox desktop (#1445).FIXED
Disabled WebM in Safari 14 until bug in Safari is resolved (#1476).FIXED
Error when callingseek()
on audio that hasn't loaded (#1423).FIXED
Before a sound had loaded, callingpause()
afterseek()
didn't have the intended behavior (#1439).
FIXED
The latest Safari 14 changed how WAV support was detected (#1415).FIXED
Edge case that could cause an infinite loop while fading (#1369).FIXED
Callingseek
without a seek value while a file was still loading no longer adds it to the queue and correctly returns0
(#1189).FIXED
Correctly handle finite audio files that returnInfinity
duration in Safari (#658).
ADDED
Newxhr
property that allows setting custom headers (such as for auth), changing thewithCredentials
setting and specifying the HTTP method for the request. These only apply to Web Audio (#997).ADDED
NewHowler.stop()
global stop method to stop all sounds at once (#1308).ADDED
Support form4b
audio format (#1170).CHANGED
Allow passingmetadata
string topreload
option to only preload the metadata (#1140).FIXED
Correctly handle AudioContext interrupted state causing stucksuspending
state (#1106).FIXED
Thevolume
method would sometimes return incorrect values when using very shortfade
lengths (#1045).FIXED
Error thatHowlerGlobal
was not defined when usingjsdom-global
(#1331).FIXED
Memory leak in Safari when an audio context can't be unlocked (#1338).
- The
xhrWithCredentials
property is now included in thexhr
property object with keywithCredentials
.
FIXED
Don't try to obtain HTML5 audio if there is no audio support (#1191).FIXED
The x/y/z orientations for the top of the listener weren't being set properly (#1221).FIXED
Race condition that could prevent looping audio from always looping (#1225).FIXED
Race condition that could cause the main volume to be reset to 1 if called beforeunlockAudio
(#1210).
FIXED
Removed browser check for auto play unlock since all major browsers now implement this.FIXED
Live streams now stop downloading when they are stopped, also fixing issue in Chrome with stopping twice (#1129).FIXED
Prevent error in Edge whenAudio
isn't supported (#1147).
FIXED
Regression that broke simple play/pause usage in certain edge cases (#1101).FIXED
Loading and unloading multiple Howls with the same src could cause them all to unload (#1103).
ADDED
Howler now maintains a general pool of HTML5 Audio nodes that are unlocked on first user input, which fixes issues with subsequent HTML5 Audio plays not working (#1008).ADDED
New globalhtml5PoolSize
option that allows setting the default size of the HTML5 Audio object pool (#1008).CHANGED
Since locking of audio is no longer mobile-only,mobileAutoEnable
has been renamed toautoUnlock
.FIXED
Playing a sound with locked audio in Chrome or elsewhere could causeplaying()
to returntrue
(#939).FIXED
Correctly usesetPosition
instead ofsetOrientation
in Safari (#1033).FIXED
Prevent error onseek
orduration
being negative (#1034).FIXED
Forcefade
values to be numbers to prevent errors (#1027).FIXED
AnInvalidStateError
could sometimes be thrown in Internet Explorer (#1052).FIXED
Prevent silent failure ofAudioContext
creation in Safari (#1021).FIXED
Changingrate
andseek
on a paused sound could causeseek
to end up at the wrong position (#1088).FIXED
Callingplay
twice before a sound had loaded could lead to both sounds having the sameID
(#1060).
- If you are directly setting
Howler.mobileAutoEnable
(it defaults to true), then you should change this toHowler.autoUnlock
. - The new HTML5 Audio object pool shouldn't change anything for 99% of use-cases, but if for whatever reason you don't want to use the pool, you can set
html5PoolSize
to 0 to bypass using the pool.
FIXED
Errors with touch events and blocked click events in Chrome (#1003 #1011 #1025 #1026).FIXED
Audio decoding error wasn't always handled correctly (#1019).FIXED
Potential error during playback in Internet Explorer 11 (#1016).
CHANGED
Auto unlocking of audio now runs on Chrome to fix issue with HTML5 Audio needing user interaction.CHANGED
Added a newunlock
event that is fired when the auto unlock happens.CHANGED
Aplayerror
now gets fired when HTML5 Audio fails to play due to lack of user interaction.FIXED
Improved HTML5 Audio play lock checks to prevent race conditions (#995).FIXED
Intermittent error in Chrome when decoding audio data (#988).FIXED
Error when trying to loop spatial audio without a sprite (#985).FIXED
Instantly fire theend
event when a sound is seeked past its duration (#963).FIXED
Another issue in Safari where spatial orientation was throwing an error.
FIXED
Preventstop
event from firing alongsideend
when using HTML5 Audio (#974).FIXED
Correctly reset aSound
after using spatial audio (#962).FIXED
Remove aHowl
from cache when unloaded after failing to load (#978).FIXED
Race condition could lead to error when cleaning the buffer.
FIXED
The previous Chrome deprecation fixes broke spatial positioning in Safari.
FIXED
Fixed another Chrome deprecation warning when using panning methods (#923).FIXED
Playback rate wasn't working correctly in Internet Explorer when defined in theHowl
constructor (#936).FIXED
Looped audio would only play twice in Internet Explorer (#921).
FIXED
More accurate HTML5 Audioend
timer and fix for Firefox streams ending early (#883).FIXED
Preventplay
events from duplicating in certain instances (#899).FIXED
Add second parameter to HTML5 Audio playback promise to fix Safari error (#896).FIXED
Refactored the internal queue system to fix various edge cases.
CHANGED
Fades now use elapsed time to be more accurate when intervals are inconsistent (#885).CHANGED
Improve timing of short fades (#884).FIXED
Fixed another Chrome deprecation when setting playback rate.FIXED
Preventonplay
from firing when first settingstereo
value (#843).
FIXED
Accidentalconst
was included in the previous version.
FIXED
Replaced deprecatedgain.value
andgain.pan.value
withsetValueAtTime
(#856).FIXED
Audio sprites weren't ending correctly in Internet Explorer 11 (#841).FIXED
Correctly set group volume when fading (#539).FIXED
Cancelfade
on sound whenmute
is called (#666).FIXED
Uncaught error when play() request was interrupted by a call to pause() (#835).FIXED
Incorrect reference to global_scratchBuffer
(#834).
ADDED
Add support forwithCredentials
to Web Audio XHR requests (#610).ADDED
Addplayerror
event for when mobile HTML5 audio is unable to play (#774).FIXED
Refactor fade method to eliminate bind memory allocations (no change to API).FIXED
Prevent seeking after sound has been unloaded (#797).FIXED
Check forpaused
instead ofended
on HTML5 end check to correctly handle data URI's (#775).FIXED
Fix unlocking of mobile audio on iOS when user swipes instead of taps (#808).FIXED
pannerAttr
values can now be set via object as the documentation originally specified.FIXED
Various corrections and improvements to the spatial audio documentation.
CHANGED
Removed theresuming
state, which wasn't actually being used and was leading to a bug on Android (#679).CHANGED
Any playback initiated before the sound has loaded will now go into the queue to fix various race conditions (#714).FIXED
Correctly initialize an AudioContext with the global mute status (#714).FIXED
AudioContext unlocks on user interaction within a cross-domain iframe on Android Chrome (#756).FIXED
Stopping/pausing a group of sounds now behaves as expected in edge cases (#734).FIXED
Sound ID's now start at 1000 instead of 0 to avoidrate
collisions (#764).FIXED
Prevent unknown mime errors on Internet Explorer when unloading a sound (#720).FIXED
Correctly clean up error event listeners (#720).FIXED
Audio clipping in Internet Explorer when network latency is present with HTML5 Audio (#720).FIXED
Allow passing just an event and ID to turn off listener (#767).FIXED
npm
warning caused by invalid license definition (#763).
CHANGED
Unloading a sound no longer fires theend
event (#675).FIXED
RemovesetTimeout
wrapper on HTML5play
call to fix issues on mobile browsers (#694).FIXED
Remove rare possibility of duplicate sound ID's by using global counter (#709).FIXED
Support fades with 2+ decimal places (#696).FIXED
Error in Firefox caused by invalid silent WAV onunload
(#678).FIXED
Check for and warn about missing file extension (#680).FIXED
Regression in Firefox relating to spatial audio (#664).
FIXED
Wait to begin playback until AudioContext has resumed (#643).FIXED
RunnoAudio
check on initial setup instead of waiting for firstHowl
(#619).FIXED
Addplay
event to start of queue whenautoplay
is used (#659).FIXED
Make sureseek
andduration
are always >= 0 to prevent errors (#682).FIXED
Audio test wouldn't work in IE11 Enhanced Security Mode (#631).FIXED
Ensure AudioContext exists onunload
(#646).FIXED
Always fire pause event even if sound is already paused (#639).
ADDED
Support for FLAC audio files.FIXED
Improve fading performance when short fade times are used (#621).FIXED
Correctly handle fades from 0 to 0 volume (#575).FIXED
Prevent a load error from blocking all future playback (#613).FIXED
ResetnoAudio
tofalse
when a sound is unloaded (#617).FIXED
Stop a sound even if it is not playing (#595).FIXED
Emitstop
event before returning fromstop
(#616).FIXED
Improve codec checks by removingx-
prefix (#576).FIXED
Set correct loop start/end when callingloop
on a sprite (#604).
This major release contains just a few breaking changes outlined below. Howler.js has been rewritten from the ground up using the knowledge and work since the initial release. There's a long list of additions and improvements, which I urge you to read through as the library has evolved quite a bit over this time.
The biggest change is how you should think about your audio when using howler.js. There is now the concept of global (Howler
), group (Howl
) and single sound (Sound
). Each sound that is played gets its own Sound
object that can be manipulated, giving much greater control over playback, whether using sprites or not. Howl
method calls can then apply to one sound or all in the group.
Howler (global) ->
Howl (group) ->
Sound (single)
Howler.js now also has the concept of plugins. The core represents 100% compatibility across hTML5 Audio and Web Audio, adhering to the initial goals of the library. There is also a new Spatial Plugin that adds 3D and stereo audio support only available in the Web Audio API.
Read more about the update in this blog post.
- The
buffer
option is now namedhtml5
. Use this to force HTML5 Audio usage. - The
urls
option is now namedsrc
to specify the audio file(s) to play. - The
pos
method has been renamed toseek
.
// Change the seek position of a sound (in seconds).
sound.seek(10);
mute
andunmute
have been consolidated intomute
.
// Mute a sound (or all sounds).
sound.mute(true);
Howler.mute(true);
// Unmute a sound (or all sounds).
sound.mute(false);
Howler.mute(false);
- The
play
method no longer takes a callback and immediately returns the playback sound id (this means you can no longer chain onto theplay
method, but all others work the same).
// Get sound id for a specific playback.
var id = sound.play();
// Pause this playback.
sound.pause(id);
- The deprecated
fadeIn
andfadeOut
methods have been removed in favor of the singlefade
method.
// Fade in a sound.
sound.fade(0, 1, 1000);
// Fade out the sound once the previous fade has ended.
sound.once('fade', function(){
sound.fade(1, 0, 1000);
});
- Lots of general code cleanup, simplification and reorganization.
- Howler.js is now modularized. The core represents the initial goal for howler.js with 100% compatibility across HTML5 Audio and Web Audio. The spatial plugin adds spatial and stereo support through Web Audio API.
- The new structure allows for full control of sprite playback (this was buggy or didn't work at all before).
- New
once
method to setup event listeners that will automatically remove themselves once fired. - New
playing
method that will returntrue
if the specified sound is currently playing. - New
duration
method that will return the duration of the audio source. - New
state
method that will return the loaded state of the Howl. - New
preload
option to allow disabling the auto-preload functionality. - New events:
fade
,stop
,mute
,volume
,rate
,seek
. - New
rate
method that allows changing playback rate at runtime. - New global
unload
method that unloads all active Howls and resets theAudioContext
to clear memory. - New
pool
option to allow setting the inactive sound pool size (for advanced use, still defaults to 5). - Support for playback of Dolby Audio files.
- Support for .webm extension in addition to .weba.
- Support for playback of CAFF audio files.
- (Spatial) New
Howler
listener methodsstereo
,pos
andorientation
. - (Spatial) New
Howl
methodsstereo
,pos
,orientation
andpannerAttr
to control stereo and spatial audio of single sounds or groups of sounds. - (Spatial)
pannerAttr
allows for control ofconeInnerAngle
,coneOUterAngle
,coneOuterGain
,distanceModel
,maxDistance
,panningModel
,refDistance
androlloffFactor
. - Third parameter to
on
,once
andoff
to allow listening or removing events for only a specific sound id. - The following methods now alter all sounds within a
Howl
group when noid
is passed:pause
,stop
,volume
,fade
,mute
,loop
,rate
. - New codec recommendations and notes have been added to the documentation.
- Web Audio AudioContext now automatically suspends and resumes to lower processing and power usage.
- Improved the
ext
option and made it especially usefully for playing streams (for example, SoundCloud). - The
fade
method now uses native Web Audio fading when in that mode. - Fades are now automatically stopped when a new one is started, volume is changed or the sound is paused/stopped.
- Moved any needed try/catch statements into own methods to prevent de-optimization in V8 and others.
- Automatically checks for disabled audio in Internet Explorer.
- An internal event queue is now used to fix issues caused by multiple actions pre-load.
- When using Web Audio, a panner node is only added when spatial audio is used.
- The
rate
option now changes the playback rate on both Web Audio and HTML5 Audio. - The event system has been overhauled to be more reliable.
- Methods called before a sound has loaded no longer cause events to stick in the queue.
- The
end
event correctly fires at the end of each loop when using Web Audio. - Several issues with playback of sprites.
- Several issues with playback timing after pausing sounds.
- Improved support for seeking a sound while it is playing.
- When playback rate is changed, the
end
event now fires at the correct time. - Potential memory leak when using the
unload
method. - Calling
pause
on a sound that hasn't yet loaded now works correctly. - Muting a sound while it is fading now works.
- Playback of base64 encoded sounds in Internet Explorer 9.
- MIME check for some base64 encoded MP3's.
- Now tries to automatically unlock audio on mobile browsers besides Mobile Safari.
- Falls back to HTML5 Audio when loading an HTTP file on an HTTPS page (avoids Mixed Content errors).
- Stopping a stream is now possible, along with various other fixes.
- Audio on Chrome for Android no longer gets stuck after a period of inactivity.
- Crash in iOS <9 webview.
- Bug in iOS that can cause audio distortion when opening/closing browser.
- Only setup AudioContext after first
Howl
is setup so that background audio on mobile devices behaves as expected.
ADDED
Error messages added onto eachloaderror
event (thanks Philip Silva).FIXED
Various edge-case bugs by no longer comparing functions by string in.off()
(thanks richard-livingston).FIXED
Edge case where multiple overlapping instances of the same sound won't all fireend
(thanks richard-livingston).FIXED
end
event now fires correctly when changing therate
of a sound.
FIXED
Typo with iOS enabler that was preventing it from working.
FIXED
Automatic audio unlocking on iOS 9 by switching totouchend
fromtouchstart
.
FIXED
Looping in Chrome due to a change in the Web Audio spec implemented in Chrome 42.
ADDED
TheAudioContext
is now available on the globalHowler
object (thanks Matt DesLauriers).FIXED
When falling back to HTML5 Audio due to XHR error, delete cache for source file to prevent multi-playback issues.
FIXED
Improved performance of loading files using data URIs (thanks Rob Wu).FIXED
Data URIs now work with Web Audio API (thanks Rob Wu).FIXED
Omitting the second parameter of theoff
method now correctly clears all events by that name (thanks Gabriel Munteanu).FIXED
Fireend
event when unloading playing sounds.FIXED
Small error fix in iOS check.
FIXED
Playing multiple sprites rapidly with HTML5 Audio cause the sprite to break due to a v1.1.22 update.FIXED
Don't run the iOS test if there is no audio context, which prevents a breaking error.
ADDED
Howler will now automatically attempt to unlock audio on iOS (thanks Federico Brigante).ADDED
Newcodecs
global Howler method to check for codec support in the current browser (thanks Jay Oster).FIXED
End timers are now correctly cleaned up when a sound naturally completes rather than being forced to stop.
ADDED
Support for npm and bower (thanks Morantron).ADDED
Support for audio/aac, audio/m4a and audio/mp4 mime types (thanks Federico Brigante).FIXED
Calculation of duration after pausing a sprite that was sometimes causing unexpected behavior.FIXED
Clear the event listener when creating a new HTML5 Audio node.
ADDED
When using Web Audio API, the panningModel now defaults to 'equalpower' to give higher quality sound. It then automatically switches to 'HRTF' when using 3D sound. This can also be overridden with the newmodel
property.FIXED
Another bug causing issues in CocoonJS (thanks Olivier Biot).FIXED
Issue that could have caused invalid state errors and a memory leak when unloading in Internet Explorer.FIXED
The documentation has been updated to include therate
property.
ADDED
Added CocoonJS support (thanks Olivier Biot).FIXED
Several issues with pausing sprite instances by overhauling how end timers are tracked and cleared internally.FIXED
Prevent error when using a server-side require where window is absent (thanks AlexMost).
FIXED
Muting a looping sound now correctly keeps the sound muted when using HTML5 Audio.FIXED
Wrap AudioContext creation in try/catch to gracefully handle browser bugs: Chromium issue (thanks Chris Buckley).FIXED
Listen for HTML5 Audio errors and fireloaderror
if any are encountered (thanks digitaltonic).
FIXED
Another bug in Chrome that would throw an error when pausing/stopping when a source is already stopped.ADDED
CommonJS support for things like Browserify (thanks Michal Kuklis).ADDED
Support for playback mp4 files.ADDED
Expose thenoAudio
variable to the globalHowler
object.FIXED
A rounding error that was causing HTML5 Audio to cut off early on some environments.FIXED
Theonend
callback now correctly fires when changing the pos of a sound after it has started playing and when it is using HTML5 Audio.
FIXED
Prevent InvalidStateError when unloading a sound that has already been stopped.FIXED
Bug in unload method that prevented the first sound from being unloaded.
FIXED
Bug that prevented master volume from being set to 0.FIXED
Bug that prevented initial volume from being set to 0.FIXED
Update the README to accurately showautoplay
as defaulting tofalse
.FIXED
Callloaderror
when decodeAudioData fails.FIXED
Bug in setting position on an active playing WebAudio node through 'pos(position, id)' (thanks Arjun Mehta).FIXED
An issue with looping after resuming playback when in WebAudio playback (thanks anzev).
FIXED
Critical bug fix that was breaking support on some browsers and some codecs.
FIXED
Code cleanup by removing redundantcanPlay
object (thanks Fabien).FIXED
File extensions are now detected correctly if there is a query string with dots in the filename (thanks theshock).FIXED
Fireonloaderror
if a bad filename is passed with theurls
property.
UPDATED
Changed AMD definition to anonymous module and define it as global always (thanks Fabien).ADDED
Added therate
property toHowl
object creation, allowing you to specify the playback rate. This only works when using Web Audio (thanks Qqwy).FIXED
Prevent some instances of IE9 from throwing "Not Implemented" error (thanks Tero Tilus).
FIXED
Bug caused by trying to disconnect audio node when using HTML5 Audio.FIXED
Correctly return the sound's position when it is paused.FIXED
Another bug that caused looping sounds to not always correctly resume after a pause.
ADDED
Newunload
method to destroy a Howl object. This will stop all associated sounds instantly and remove the sound from the cache.FIXED
When using Web Audio, loop from the correct position after pausing the sound halfway through.FIXED
Always return a number when getting a sound's position with thepos
method, and always return the reference to the sound when setting a sound that hasn't loaded.
FIXED
Issue where calling thevolume
method before a sound had loaded prevented the volume from being changed.
FIXED
urls
method now works again, and can take a string rather than an array if only one url is being passed.FIXED
Makenode.play
async when not using webAudio (thanks Alex Dong).
FIXED
Hotfix for a missing parameter that somehow missed the 1.1.6 commit in global muting.
ADDED
A generalfade
method that allows a playing sound to be faded from one volume to another.DEPRECATED
ThefadeIn
andfadeOut
methods should no longer be used and have been deprecated. These will be removed in a future major release.FIXED
No longer require the sprite parameter to be passed into theplay
method when just passing a callback function.FIXED
Cleaned up global muting code. (thanks arnorhs).
ADDED
Support for the Ogg Opus codec (thanks Andrew Carpenter).ADDED
Semver tags for easy package management (thanks Martin Reurings).ADDED
Improve style/readability of code that discovers which audio file extension to use (thanks Fabien).ADDED
Theonend
event now passes the soundId back as the 2nd parameter of the callback (thanks Ross Cairns).FIXED
A few small typos in the comments. (thanks VAS).
FIXED
A few small bugs that broke global mute and unmute when using HTML5 Audio.
FIXED
Bug that prevented global mute from working 100% of the time when using HTML5 Audio.
FIXED
Callingvolume
beforeplay
now works as expected.FIXED
Edge case issue with cache cleaning.FIXED
Load event didn't fire when new URLs were loaded after the initial load.
ADDED
onloaderror
event fired when sound fails to load (thanks Thiago de Barros Laceda).ADDED
format
property that overrides the URL extraction of the file format (thanks Kenan Shifflett).FIXED
AMD implementation now only defines one module and removes global scope (thanks Kenan Shifflett).FIXED
Broken chaining withplay
method.
ADDED
Newpos3d
method that allows for positional audio (Web Audio API only).ADDED
Multi-playback control system that allows for control of specific play instances when sprites are used. A callback has been added to theplay
method that returns thesoundId
for the playback instance. This can then be passed as the optional last parameter to other methods to control that specific playback instead of the whole sound object.ADDED
Pass theHowl
object reference as the first parameter in the custom event callbacks.ADDED
New optional parameter in sprite definitions to define a sprite as looping rather than the whole track. In the sprite definition array, set the 3rd value to true for looping (spriteName: [pos, duration, loop]
).FIXED
Now all audio acts as a sound sprite internally, which helps to fix several lingering bugs (doesn't affect the API at all).FIXED
Improved implementation of Web Audio API looping.FIXED
Improved implementation of HTML5 Audio looping.FIXED
Issue that caused the fallback to not work when testing locally.FIXED
Fireonend
event at the end offadeOut
.FIXED
Prevent errors from being thrown on browsers that don't support HTML5 Audio.FIXED
Various code cleanup and optimizations.
ADDED
Support for AMD loading as a module (thanks @mostlygeek).
ADDED
Automatically switch to HTML5 Audio if there is an error due to CORS.FIXED
Check that only numbers get passed into volume methods.
ADDED
ExposedusingWebAudio
value through the globalHowler
object.FIXED
Issue with non-sprite HTML5 Audio clips becoming unplayable (thanks Paul Morris).
FIXED
Issue that caused simultaneous playback of audio sprites to break while using HTML5 Audio.
ADDED
Spec-implementation detection to cover new and deprecated Web Audio API methods (thanks @canuckistani).
ADDED
Newonplay
event.ADDED
Support for playing audio from base64 encoded strings.FIXED
Issue with soundId not being unique when multiple sounds were played simultaneously.FIXED
Verify that an HTML5 Audio Node is ready to play before playing it.FIXED
Issue withonend
timer not getting cleared all the time.
FIXED
Cancel the correct timer when multiple HTML5 Audio sounds are played at the same time.FIXED
Make sure howler.js is future-compatible with UglifyJS 2.FIXED
Duration now gets set correctly when pulled from cache.FIXED
Tiny typo in README.md (thanks @johnfn).
FIXED
Issue with global mute calls happening before an HTML5 Audio element is loaded.
FIXED
Global mute now also mutes all future sounds that are played untilunmute
is called.
ADDED
Support for WebM audio.FIXED
Issue with volume changes when on HTML5 Audio.FIXED
Round volume values to fix inconsistencies in fade in/out methods.
FIXED
Make sureself
is always defined before returning it.
ADDED
Newoff
method that allows for the removal of custom events.FIXED
Issue with chaining theon
method.FIXED
Small typo in documentation.
ADDED
Newbuffer
property that allows you to force the use of HTML5 on specific sounds to allow streaming of large audio files.ADDED
Support for multiple events per event type.FIXED
Issue with method chaining before a sound was ready to play.FIXED
Useself
everywhere instead ofthis
to maintain consistency.
- First commit