title: How to record audio mp3 javascript
body: <p>I'm developing a web that need to record user's voice as a mp3 file. 
  I have this code and it save the audio as a webm file,and the problem is that  if I download the file I can't restart the audio and I can't listen to a certain min.
  this is my code :</p>
  
  <pre><code>  navigator.mediaDevices.getUserMedia({ audio: true }).then(function(microphone) {
    // preview camera during recording
    document.getElementById('your-video-id').style.display="none";
    document.getElementById('your-video-id').muted = true;
    setSrcObject(microphone, document.getElementById('your-video-id'));
    // recording configuration/hints/parameters
    var recordingHints = {
        type: 'audio'
    };
    // initiating the recorder
    var recorder = RecordRTC(microphone, recordingHints);
    // starting recording here
    recorder.startRecording();
    // auto stop recording after 5 seconds
    setTimeout(function() {
        // stop recording
        recorder.stopRecording(function() {
  
            // get recorded blob
            var blob = recorder.getBlob();
            // generating a random file name
            var fileName = getFileName('mp3');
            // we need to upload "File" --- not "Blob"
            var fileObject = new File([blob], fileName, {
                type: 'audio/mp3'
            });
            var storageRef = firebase.storage().ref(fileObject.name);
            storageRef.put(blob);
        });
    }, milliSeconds);
  });
  </code></pre>