Comparing version 1.2.2 to 1.2.3
@@ -28,3 +28,2 @@ (function(e){if("function"==typeof bootstrap)bootstrap("hark",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeHark=e}else"undefined"!=typeof window?window.hark=e():global.hark=e()})(function(){var define,ses,bootstrap,module,exports; | ||
// make it not break in non-supported browsers | ||
@@ -40,9 +39,7 @@ if (!audioContextType) return harker; | ||
history = options.history || 10, | ||
audioContext = options.audioContext || null, | ||
running = true; | ||
//Setup Audio Context | ||
if (!audioContext) { | ||
audioContext = new audioContextType(); | ||
} | ||
// Ensure that just a single AudioContext is internally created | ||
audioContext = options.audioContext || audioContext || new audioContextType(); | ||
var sourceNode, fftBins, analyser; | ||
@@ -149,3 +146,2 @@ | ||
return harker; | ||
@@ -152,0 +148,0 @@ } |
10
hark.js
@@ -26,3 +26,2 @@ var WildEmitter = require('wildemitter'); | ||
// make it not break in non-supported browsers | ||
@@ -38,9 +37,7 @@ if (!audioContextType) return harker; | ||
history = options.history || 10, | ||
audioContext = options.audioContext || null, | ||
running = true; | ||
//Setup Audio Context | ||
if (!audioContext) { | ||
audioContext = new audioContextType(); | ||
} | ||
// Ensure that just a single AudioContext is internally created | ||
audioContext = options.audioContext || audioContext || new audioContextType(); | ||
var sourceNode, fftBins, analyser; | ||
@@ -147,4 +144,3 @@ | ||
return harker; | ||
} |
{ | ||
"name": "hark", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Converts an audio stream to speech events in the browser", | ||
@@ -5,0 +5,0 @@ "main": "hark.js", |
@@ -71,3 +71,3 @@ # Hark | ||
* `play` (optional, default true for audio tags, false for webrtc streams) whether the audio stream should also be piped to the speakers, or just swallowed by the analyser. Typically for audio tags you would want to hear them, but for microphone based webrtc streams you may not to avoid feedback. | ||
* `audioContext` (optional, default is to create a new context) If you have already created an `AudioContext`, you can pass it to hark to avoid unnecessarily creating more than one. | ||
* `audioContext` (optional, default is to create a single context) If you have already created an `AudioContext`, you can pass it to hark to use it instead of an internally generated one. | ||
@@ -74,0 +74,0 @@ ## Understanding dB/volume threshold |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18273
381