         @audioCtx.close()
         @audioCtx = null
 
-      @em.dispatchEvent(new CustomEvent('recording', {detail: {recording: recording}}))
+      @em.dispatchEvent(new CustomEvent('recording', { detail: { recording: recording } }))
       return
 
     _onError: (evt) ->
       console.log('error', evt)
       @em.dispatchEvent(new Event('error'))
-      alert('error:' + evt) # for debugging purposes
       return
 )

            outputBuffer: e.outputBuffer
          }
        }))

      # # Example handling:
      # inputBuffer = e.inputBuffer
      # outputBuffer = e.outputBuffer
      # # Each channel (usually only one)
      # for (channel = 0; channel < outputBuffer.numberOfChannels; channel++) {
      #   inputData = inputBuffer.getChannelData(channel)
      #   outputData = outputBuffer.getChannelData(channel)
      #
      #   # Each sample
      #   for (sample = 0; sample < inputBuffer.length; sample++) {
      #     # Make output equal to the same as the input (thus processor is doing nothing at this time)
      #     outputData[sample] = inputData[sample]
      #   }
      # }

      # When manually encoding (safari/edge), there's no reason to copy data to output buffer.  We set the output
      # gain to 0 anyways (which is required on Edge if we did copy data to output). However, if using a MediaRecorder
      # and a processor (all other browsers), then it would be required to copy the data otherwise the graph would
      # generate no data for the MediaRecorder to consume.
      # if (forceScriptProcessor) {

      # # Copy input to output
      # inputBuffer = e.inputBuffer
      # outputBuffer = e.outputBuffer
      # # This doesn't work on iOS/Safari. Guessing it doesn't have copyToChannel support, but haven't verified.
      # for (channel = 0; channel < outputBuffer.numberOfChannels; channel++) {
      #   outputBuffer.copyToChannel(inputBuffer.getChannelData(channel), channel)
      # }

      # Safari and Edge require manual encoding via web worker. Single channel only for now.
      # Example stereo encoderWav: https:#github.com/MicrosoftEdge/Demos/blob/master/microphone/scripts/recorderworker.js
      if (!@usingMediaRecorder)
        if (@state == 'recording')
          if (@config.broadcastAudioProcessEvents)

            @encoderWorker.postMessage(['encode', e.inputBuffer.getChannelData(0)])
      return

    # Called once when the recording has been stopped
    stopRecording: () ->
      if (@state == 'inactive')
        return
