Socket
Socket
Sign inDemoInstall

musquito

Package Overview
Dependencies
4
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

dist/musquito-2.1.1.js

2

index.js

@@ -1,1 +0,1 @@

module.exports = require('./dist/musquito-2.1.0');
module.exports = require('./dist/musquito-2.1.1');
{
"name": "musquito",
"version": "2.1.0",
"version": "2.1.1",
"description": "An audio engine for HTML5 games and interactive websites",

@@ -5,0 +5,0 @@ "keywords": [

@@ -12,2 +12,3 @@ <p align="center">

- Built on the powerful Web Audio API
- Simple API to create and play sounds

@@ -135,2 +136,6 @@ - Supports variety of codecs

For demos and detailed documentation please visit [here](http://musquitojs.com).
## API

@@ -160,2 +165,3 @@

| autoplay | boolean | no | false | Pass `true` to play the sound at-once created. |
| stream | boolean | no | false | Passing `true` will use HTML5 audio node for playing the sound. This option you can use to play long audio files like background music in a game. This feature is available only in version v2. |
| format | string, Array<string> | no | false | Single or array of audio formats for the passed audio sources. |

@@ -181,3 +187,3 @@ | sprite | object | no | | The sprite definition object that contains the starting and ending positions of each sound embedded in the sprite. |

|--------|:-------:|-------------|
| load() | Buzz | Loads the audio buffer. |
| load(soundId?: string) | Buzz | Loads the audio buffer or preloads a HTML5 audio node. The `soundId` can be passed only in the case stream buzz type. When you pass it that particular sound's audio node will be pre-loaded. |
| play(soundOrId?: string, number) | Buzz | Plays a new sound or the passed sound defined in the sprite or the sound that belongs to the passed id. |

@@ -203,6 +209,8 @@ | pause(id?: number) | Buzz | Pauses the sound belongs to the passed id or all the sounds belongs to this group. |

| id() | number | Returns the unique id of the sound. |
| loadState() | LoadState | Returns the audio resource loading status. |
| loadState() | LoadState | Returns the audio resource loading status. The different values are "notloaded", "loading" and "loaded". |
| isLoaded() | boolean | Returns true if the audio source is loaded. |
| sound(id: number) | Sound | Returns the sound for the passed id. |
| alive(id: number) | boolean | Returns true if the passed sound exists. |
| sounds() | Array<Sound> | Returns all the sounds belongs to this buzz group. |
| alive(id: number) | boolean | Returns `true` if the passed sound exists. |
| gain() | GainNode | Returns the gain node. |

@@ -215,3 +223,3 @@ ### `$buzz` static / global methods

|--------|:-------:|-------------|
| setup(args?: object) | $buzz | Sets-up the audio engine. |
| setup(args?: object) | $buzz | Sets-up the audio engine. The different parameters you can pass in arguments object are `volume`, `muted`, `maxNodesPerSource`, `cleanUpInterval`, `autoEnable` and event handler functions like `onstop`, `onmute`, `onvolume`, `onsuspend`, `onresume`, `onerror` and `ondone`. |
| load(urls: string, Array<string>, progressCallback: function) | Promise | Loads single or multiple audio resources into audio buffers and returns them. |

@@ -229,3 +237,5 @@ | loadMedia(urls: string, Array<string>) | Promise | Pre-loads single or multiple HTML5 audio nodes with the passed resources and returns them. |

| muted() | boolean | Returns whether the engine is currently muted or not. |
| state() | EngineState | Returns the state of the engine. |
| state() | EngineState | Returns the state of the engine. The different values are "notready", "ready", "suspending", "suspended", "resuming", "destroying", "done" and "no-audio". |
| buzz(id: number) | Buzz | Returns the buzz for the passed id. |
| buzzes() | Array<Buzz> | Returns all the buzzes. |
| context() | AudioContext | Returns the created audio context. |

@@ -242,1 +252,9 @@ | isAudioAvailable() | boolean | Returns true if Web Audio API is available. |

MIT
Copyright © 2020 · Vijaya Anand · All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@@ -284,2 +284,4 @@ import engine from './Engine';

this._endPos = this._stream ? this._audio.duration : this._buffer.duration;
// Set other properties.

@@ -299,3 +301,2 @@ volume && (this._volume = volume);

this._endPos = this._stream ? this._audio.duration : this._buffer.duration;
this._duration = this._endPos - this._startPos;

@@ -302,0 +303,0 @@ this._isSprite = this._duration < this._endPos;

@@ -29,3 +29,3 @@ import webpack from 'webpack';

`/*!
* musquito v2.1.0
* musquito v2.1.1
* http://musquitojs.com

@@ -32,0 +32,0 @@ *

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc