Skip to content
Snippets Groups Projects
Commit 9636514c authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5253 from Gyubin/develop

Fix the over creation of AudioContexts when record audio message.
parents 18317b89 d5194661
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
navigator.getUserMedia = navigator.getUserMedia or navigator.webkitGetUserMedia
window.URL = window.URL or window.webkitURL
@audio_context = new AudioContext
window.audioContext = new AudioContext
ok = (stream) =>
@startUserMedia(stream)
......@@ -18,7 +18,7 @@
startUserMedia: (stream) ->
@stream = stream
input = @audio_context.createMediaStreamSource(stream)
input = window.audioContext.createMediaStreamSource(stream)
@recorder = new Recorder(input, {workerPath: '/recorderWorker.js'})
@recorder.record()
......@@ -32,9 +32,10 @@
@recorder.clear()
delete @audio_context
window.audioContext.close()
delete window.audioContext
delete @recorder
delete @stream
getBlob: (cb) ->
@recorder.exportWAV cb
\ No newline at end of file
@recorder.exportWAV cb
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment