Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

howler

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

howler - npm Package Compare versions

Comparing version 2.0.0-beta9 to 2.0.0-rc1

dist/howler.core.min.js

9

CHANGELOG.md

@@ -39,6 +39,6 @@ ## 2.0.0 (TBD)

- `ADDED`: Web Audio AudioContext now automatically suspends and resumes to lower processing and power usage.
- `ADDED`: (Effects) New `Howler` listener methods `pos`, `orientation`, `velocity` and `listenerAttr`.
- `ADDED`: (Effects) New `Howl` methods `pos`, `orientation`, `velocity` and `pannerAttr` to control spatial audio of single sounds or groups of sounds.
- `ADDED`: (Effects) `pannerAttr` allows for control of `coneInnerAngle`, `coneOUterAngle`, `coneOuterGain`, `distanceModel`, `maxDistance`, `panningModel`, `refDistance` and `rolloffFactor`.
- `UPDATED`: (Effects) When using Web Audio, a panner node is only added when spatial audio is used.
- `ADDED`: (Spatial) New `Howler` listener methods `stereo`, `pos` and `orientation`.
- `ADDED`: (Spatial) New `Howl` methods `stereo`, `pos`, `orientation` and `pannerAttr` to control stereo and spatial audio of single sounds or groups of sounds.
- `ADDED`: (Spatial) `pannerAttr` allows for control of `coneInnerAngle`, `coneOUterAngle`, `coneOuterGain`, `distanceModel`, `maxDistance`, `panningModel`, `refDistance` and `rolloffFactor`.
- `UPDATED`: (Spatial) When using Web Audio, a panner node is only added when spatial audio is used.
- `UPDATED`: The `play` method no longer takes a callback and immediately returns the playback sound id (this means you can no longer chain onto the `play` method, but all others work the same).

@@ -74,2 +74,3 @@ - `UPDATED`: Changed property names `buffer` to `html5` and `pos` to `seek`.

- `FIXED`: Fixed bug in iOS that can cause audio distortion when opening/closing browser.
- `FIXED`: Only setup AudioContext after first `Howl` is setup so that background audio on mobile devices behaves as expected.

@@ -76,0 +77,0 @@ ## 1.1.25 (July 29, 2014)

@@ -19,4 +19,11 @@ {

},
"main": "howler.min.js",
"version": "2.0.0-beta9",
"scripts": {
"build": "VERSION=`printf 'v' && node -e 'console.log(require(\"./package.json\").version)'` && sed -i '' '2s/.*/ * howler.js '\"$VERSION\"'/' src/howler.core.js && sed -i '' '4s/.*/ * howler.js '\"$VERSION\"'/' src/plugins/howler.spatial.js && uglifyjs --preamble \"/*! howler.js $VERSION | (c) 2013-2016, James Simpson of GoldFire Studios | MIT License | howlerjs.com */\" src/howler.core.js -c -m --screw-ie8 -o dist/howler.core.min.js && uglifyjs --preamble \"/*! howler.js $VERSION | Spatial Plugin | (c) 2013-2016, James Simpson of GoldFire Studios | MIT License | howlerjs.com */\" src/plugins/howler.spatial.js -c -m --screw-ie8 -o dist/howler.spatial.min.js && awk 'FNR==1{echo \"\"}1' dist/howler.core.min.js dist/howler.spatial.min.js | sed '3s~.*~/*! Spatial Plugin */~' | perl -pe 'chomp if eof' > dist/howler.min.js && awk '(NR>1 && FNR==1){printf (\"\\n\\n\")};1' src/howler.core.js src/plugins/howler.spatial.js > dist/howler.js",
"release": "VERSION=`printf 'v' && node -e 'console.log(require(\"./package.json\").version)'` && git tag $VERSION && git push && git push origin $VERSION && npm publish --tag beta"
},
"devDependencies": {
"uglify-js": "2.x"
},
"main": "dist/ho,ler.js",
"version": "2.0.0-rc1",
"license": {

@@ -28,7 +35,8 @@ "type": "MIT",

"src",
"howler.min.js",
"howler.core.min.js",
"howler.effects.min.js",
"dist/howler.js",
"dist/howler.min.js",
"dist/howler.core.min.js",
"dist/howler.spatial.min.js",
"LICENSE.md"
]
}

@@ -21,3 +21,3 @@ ![howler.js](http://goldfirestudios.com/proj/howlerjs/howlerjs_logo.png "howler.js")

* Uses no outside libraries, just pure Javascript
* Lightweight, 9kb filesize (3kb gzipped)
* As light as 7kb gzipped

@@ -42,3 +42,3 @@ ### Browser Compatibility

* Install with [npm](https://www.npmjs.com/package/howler): `npm install howler`
* Hosted CDN: [`cdnjs`](http://bower.io/) [`jsDelivr`](http://bower.io/)
* Hosted CDN: [`cdnjs`](https://cdnjs.com/libraries/howler) [`jsDelivr`](https://www.jsdelivr.com/projects/howler.js)

@@ -186,3 +186,3 @@ ### Examples

#### playing(id)
Check if a sound is currently playing or not, returns a `Boolean`.
Check if a sound is currently playing or not, returns a `Boolean`. If no sound ID is passed, check if any sound in the `Howl` group is playing.
* **id**: `Number` The sound ID to check.

@@ -192,3 +192,3 @@

Get the duration of the audio source. Will return 0 until after the `load` event fires.
* **id**: `Number` `optional` The sound ID to check. If none is passed, the first sound is checked.
* **id**: `Number` `optional` The sound ID to check. Passing an ID will return the duration of the sprite being played on this instance; otherwise, the full source duration is returned.

@@ -252,5 +252,10 @@ #### on(event, function, [id])

### Plugin: Effects Methods
### Plugin: Spatial Methods
#### stereo(pan, [id])
Get/set the stereo panning of the audio source for this sound or all in the group.
* **pan**: `Number` A value of `-1.0` is all the way left and `1.0` is all the way right.
* **id**: `Number` `optional` The sound ID. If none is passed, all in group will be updated.
#### pos(x, y, z, [id])
Get/set the 3D spatial position of the audio source for this sound or group. The most common usage is to set the `x` position for left/right panning. Setting any value higher than `1.0` will begin to decrease the volume of the sound as it moves further away.
Get/set the 3D spatial position of the audio source for this sound or group. Setting any value higher than `1.0` will begin to decrease the volume of the sound as it moves further away.
* **x**: `Number` The x-position of the audio from `-1000.0` to `1000.0`.

@@ -268,9 +273,2 @@ * **y**: `Number` The y-position of the audio from `-1000.0` to `1000.0`.

#### velocity(x, y, z, [id])
Get/set the velocity vector of the audio source or group. This controls both direction and speed in 3D space and is relative to the listener's velocity. The units are meters/second and are independent of position and orientation.
* **x**: `Number` The x-velocity of the source.
* **y**: `Number` The y-velocity of the source.
* **z**: `Number` The z-velocity of the source.
* **id**: `Number` `optional` The sound ID. If none is passed, all in group will be updated.
#### pannerAttr(o, [id])

@@ -290,21 +288,25 @@ Get/set the panner node's attributes for a sound or group of sounds. This method can optionall take 0, 1 or 2 arguments.

### Plugin: Effects Properties
### Plugin: Spatial Properties
#### orientation `Array` `[1, 0, 0]`
Sets the direction the audio source is pointing in the 3D cartesian coordinate space. Depending on how direction the sound is, based on the `cone` attributes, a sound pointing away from the listener can be quiet or silent.
#### stereo `Number` `null`
Sets the stereo panning value of the audio source for this sound or group. This makes it easy to setup left/right panning with a value of `-1.0` being far left and a value of `1.0` being far right.
#### pos `Array` `null`
Sets the 3D spatial position of the audio source for this sound or group. The most common usage is to set the `x` position for left/right panning. Setting any value higher than `1.0` will begin to decrease the volume of the sound as it moves further away.
#### velocity `Array` `[0, 0, 0]`
Sets the velocity vector of the audio source or group. This controls both direction and speed in 3D space and is relative to the listener's velocity. The units are meters/second and are independent of position and orientation.
Sets the 3D spatial position of the audio source for this sound or group. Setting any value higher than `1.0` will begin to decrease the volume of the sound as it moves further away.
#### pannerAttr `Object`
Sets the panner node's attributes for a sound or group of sounds. See the `pannerAttr` method for all available options.
#### onstereo `Function`
Fires when the current sound has the stereo panning changed. The first parameter is the ID of the sound.
#### onpos `Function`
Fires when the current sound has the listener position changes. The first parameter is the ID of the sound.
Fires when the current sound has the listener position changed. The first parameter is the ID of the sound.
#### onorientation `Function`
Fires when the current sound has the direction of the listener changes. The first parameter is the ID of the sound.
#### onvelocity `Function`
Fires when the current sound has the listener velocity changes. The first parameter is the ID of the sound.
Fires when the current sound has the direction of the listener changed. The first parameter is the ID of the sound.
### Plugin: Global Effects Methods
### Plugin: Global Spatial Methods
#### pos(x, y, z)
Helper method to update the stereo panning position of all current `Howls`. Future `Howls` will not use this value unless explicitely set.
* **pan**: `Number` A value of -1.0 is all the way left and 1.0 is all the way right.
#### pos(x, y, z)
Get/set the position of the listener in 3D cartesian space. Sounds using 3D position will be relative to the listener's position.

@@ -324,15 +326,3 @@ * **x**: `Number` The x-position of the listener.

#### velocity(x, y, z)
Get/set the velocity vector of the listener. This controls both direction and speed in 3D space, and is combined relative to a sound's velocity to determine how much doppler shift (pitch change) to apply.
* **x**: `Number` The x-velocity of listener.
* **y**: `Number` The y-velocity of listener.
* **z**: `Number` The z-velocity of listener.
#### pannerAttr(o)
Get/set the audio listener attributes.
* **o**: `Object` All values to update.
* **dopplerFactor** `1` Determines the amount of pitch shift from doppler effect.
* **speedOfSound** `343.3` Speed of sound used to calculate doppler shift.
### Mobile Playback

@@ -339,0 +329,0 @@ By default, audio on iOS, Android, etc is locked until a sound is played within a user interaction, and then it plays normally the rest of the page session ([Apple documentation](https://developer.apple.com/library/safari/documentation/audiovideo/conceptual/using_html5_audio_video/PlayingandSynthesizingSounds/PlayingandSynthesizingSounds.html)). The default behavior of howler.js is to attempt to silently unlock audio playback by playing an empty buffer on the first `touchend` event. This behavior can be disabled by calling:

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc