title: How can I use recorded audio from web browser as a value in HTML form?
body: <p>Currently I'm making web based voice recorder which will upload the recorded audio to the server. Before upload it to server, the user need to record audio &amp; input few fields such as audio name etc.</p>
  
  <p>I'm using RecordJs from MattDiamond <a href="https://github.com/mattdiamond/Recorderjs" rel="nofollow">https://github.com/mattdiamond/Recorderjs</a>. When a user clicks on the stop recording button, an audio player will appear and user can play it. If the user decided to use it, they will click a button to use that audio and it will be an input value to a file type input field. The code is shown as below:</p>
  
  <pre><code>var url;
  
  function stopRecording() {
      mediaStream.stop();
      rec.stop();
      rec.exportWAV(function(e) {
          rec.clear();
          //Recorder.forceDownload(e, "test.wav");
          url = Recorder.getAudioUrl(e, "audio.wav");
          document.getElementById("audioPlayer").src = url;
          document.getElementById("audioPlayer").style.display = "";
      });
  }
  
  function setInputFile() {
      document.getElementById("filename").value = url;
  } 
  </code></pre>
  
  <p>So far, I managed to capture the audio and play the recorded audio from my browser but I stuck at next step which is to set the recorded audio as a value to the input field. Using document.getElementById("filename").value = url; give an error. Could please anyone in the forum give any suggestion how to set it?</p>