recorder-js
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "recorder-js", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Record audio in your browser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,23 +26,27 @@ import Microphone from './microphone'; | ||
init(stream) { | ||
this.inputPoint = this.audioContext.createGain(); | ||
return new Promise((resolve) => { | ||
this.inputPoint = this.audioContext.createGain(); | ||
this.stream = stream; | ||
this.stream = stream; | ||
this.realAudioInput = this.audioContext.createMediaStreamSource(stream); | ||
this.audioInput = this.realAudioInput; | ||
this.audioInput.connect(this.inputPoint); | ||
this.realAudioInput = this.audioContext.createMediaStreamSource(stream); | ||
this.audioInput = this.realAudioInput; | ||
this.audioInput.connect(this.inputPoint); | ||
this.analyserNode = this.audioContext.createAnalyser(); | ||
this.analyserNode.fftSize = 2048; | ||
this.inputPoint.connect(this.analyserNode); | ||
this.analyserNode = this.audioContext.createAnalyser(); | ||
this.analyserNode.fftSize = 2048; | ||
this.inputPoint.connect(this.analyserNode); | ||
this.audioRecorder = new Microphone(this.inputPoint); | ||
this.audioRecorder = new Microphone(this.inputPoint); | ||
const zeroGain = this.audioContext.createGain(); | ||
zeroGain.gain.value = 0.0; | ||
const zeroGain = this.audioContext.createGain(); | ||
zeroGain.gain.value = 0.0; | ||
this.inputPoint.connect(zeroGain); | ||
zeroGain.connect(this.audioContext.destination); | ||
this.inputPoint.connect(zeroGain); | ||
zeroGain.connect(this.audioContext.destination); | ||
this.updateAnalysers(); | ||
this.updateAnalysers(); | ||
resolve(); | ||
}); | ||
} | ||
@@ -99,2 +103,6 @@ | ||
} | ||
setOnAnalysed(handler) { | ||
this.config.onAnalysed = handler; | ||
} | ||
} | ||
@@ -101,0 +109,0 @@ |
Sorry, the diff of this file is not supported yet
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
155994
12
742