Releases: goldfire/howler.js
v2.0.4
CHANGEDRemoved theresumingstate, which wasn't actually being used and was leading to a bug on Android (#679).CHANGEDAny playback initiated before the sound has loaded will now go into the queue to fix various race conditions (#714).FIXEDCorrectly initialize an AudioContext with the global mute status (#714).FIXEDAudioContext unlocks on user interaction within a cross-domain iframe on Android Chrome (#756).FIXEDStopping/pausing a group of sounds now behaves as expected in edge cases (#734).FIXEDSound ID's now start at 1000 instead of 0 to avoidratecollisions (#764).FIXEDPrevent unknown mime errors on Internet Explorer when unloading a sound (#720).FIXEDCorrectly clean up error event listeners (#720).FIXEDAudio clipping in Internet Explorer when network latency is present with HTML5 Audio (#720).FIXEDAllow passing just an event and ID to turn off listener (#767).FIXEDnpmwarning caused by invalid license definition (#763).
v2.0.3
CHANGEDUnloading a sound no longer fires theendevent (#675).FIXEDRemovesetTimeoutwrapper on HTML5playcall to fix issues on mobile browsers (#694).FIXEDRemove rare possibility of duplicate sound ID's by using global counter (#709).FIXEDSupport fades with 2+ decimal places (#696).FIXEDError in Firefox caused by invalid silent WAV onunload(#678).FIXEDCheck for and warn about missing file extension (#680).FIXEDRegression in Firefox relating to spatial audio (#664).
v2.0.2
FIXEDWait to begin playback until AudioContext has resumed (#643).FIXEDRunnoAudiocheck on initial setup instead of waiting for firstHowl(#619).FIXEDAddplayevent to start of queue whenautoplayis used (#659).FIXEDMake sureseekanddurationare always >= 0 to prevent errors (#682).FIXEDAudio test wouldn't work in IE11 Enhanced Security Mode (#631).FIXEDEnsure AudioContext exists onunload(#646).FIXEDAlways fire pause event even if sound is already paused (#639).
v2.0.1
ADDEDSupport for FLAC audio files.FIXEDImprove fading performance when short fade times are used (#621).FIXEDCorrectly handle fades from 0 to 0 volume (#575).FIXEDPrevent a load error from blocking all future playback (#613).FIXEDResetnoAudiotofalsewhen a sound is unloaded (#617).FIXEDStop a sound even if it is not playing (#595).FIXEDEmitstopevent before returning fromstop(#616).FIXEDImprove codec checks by removingx-prefix (#576).FIXEDSet correct loop start/end when callingloopon a sprite (#604).
v2.0.0
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.
Breaking Changes
- The
bufferoption is now namedhtml5. Use this to force HTML5 Audio usage. - The
posmethod has been renamed toseek.
// Change the seek position of a sound (in seconds).
sound.seek(10);muteandunmutehave 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
playmethod no longer takes a callback and immediately returns the playback sound id (this means you can no longer chain onto theplaymethod, 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
fadeInandfadeOutmethods have been removed in favor of the singlefademethod.
// 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);
});New Features
- 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
oncemethod to setup event listeners that will automatically remove themselves once fired. - New
playingmethod that will returntrueif the specified sound is currently playing. - New
durationmethod that will return the duration of the audio source. - New
statemethod that will return the loaded state of the Howl. - New
preloadoption to allow disabling the auto-preload functionality. - New events:
fade,stop,mute,volume,rate,seek. - New
ratemethod that allows changing playback rate at runtime. - New global
unloadmethod that unloads all active Howls and resets theAudioContextto clear memory. - New
pooloption 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
Howlerlistener methodsstereo,posandorientation. - (Spatial) New
Howlmethodsstereo,pos,orientationandpannerAttrto control stereo and spatial audio of single sounds or groups of sounds. - (Spatial)
pannerAttrallows for control ofconeInnerAngle,coneOUterAngle,coneOuterGain,distanceModel,maxDistance,panningModel,refDistanceandrolloffFactor. - Third parameter to
on,onceandoffto allow listening or removing events for only a specific sound id. - The following methods now alter all sounds within a
Howlgroup when noidis 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.
Bug Fixes
- Improved the
extoption and made it especially usefully for playing streams (for example, SoundCloud). - The
fademethod 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
rateoption 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
endevent 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
endevent now fires at the correct time. - Potential memory leak when using the
unloadmethod. - Calling
pauseon 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
Howlis setup so that background audio on mobile devices behaves as expected.