mirror of
https://github.com/kevin-DL/vue-audio-recorder.git
synced 2026-01-22 15:25:19 +00:00
Remove context closing from "pause" action & minor improvoments
This commit is contained in:
@@ -7,8 +7,11 @@ export default class {
|
|||||||
this.pauseRecording = options.pauseRecording
|
this.pauseRecording = options.pauseRecording
|
||||||
this.afterRecording = options.afterRecording
|
this.afterRecording = options.afterRecording
|
||||||
this.micFailed = options.micFailed
|
this.micFailed = options.micFailed
|
||||||
this.bitRate = options.bitRate
|
|
||||||
this.sampleRate = options.sampleRate
|
this.lameOptions = {
|
||||||
|
bitRate : options.bitRate,
|
||||||
|
sampleRate : options.sampleRate
|
||||||
|
}
|
||||||
|
|
||||||
this.bufferSize = 4096
|
this.bufferSize = 4096
|
||||||
this.records = []
|
this.records = []
|
||||||
@@ -37,12 +40,13 @@ export default class {
|
|||||||
.getUserMedia(constraints)
|
.getUserMedia(constraints)
|
||||||
.then(this._micCaptured.bind(this))
|
.then(this._micCaptured.bind(this))
|
||||||
.catch(this._micError.bind(this))
|
.catch(this._micError.bind(this))
|
||||||
this.isPause = false
|
|
||||||
|
this.isPause = false
|
||||||
this.isRecording = true
|
this.isRecording = true
|
||||||
if (!this.lameEncoder) this.lameEncoder = new Encoder({
|
|
||||||
bitRate : this.bitRate,
|
if (!this.lameEncoder) {
|
||||||
sampleRate : this.sampleRate
|
this.lameEncoder = new Encoder(this.lameOptions)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stop () {
|
stop () {
|
||||||
@@ -68,7 +72,6 @@ export default class {
|
|||||||
this.stream.getTracks().forEach((track) => track.stop())
|
this.stream.getTracks().forEach((track) => track.stop())
|
||||||
this.input.disconnect()
|
this.input.disconnect()
|
||||||
this.processor.disconnect()
|
this.processor.disconnect()
|
||||||
this.context.close()
|
|
||||||
|
|
||||||
this._duration = this.duration
|
this._duration = this.duration
|
||||||
this.isPause = true
|
this.isPause = true
|
||||||
|
|||||||
Reference in New Issue
Block a user