0

I have a small web page allowing me to make a voice recording, so generating an audio clip (as a blob), and then save it locally. It works and the relevant JavaScript code is:

  var clipLink = document.createElement('a');
  clipLink.href = audioURL;
  clipLink.download = 'MyClip.wav';
  clipLink.innerHTML = 'Save locally';
  container.appendChild(clipLink);

I use navigator.mediaDevices.getUserMedia to handle the audio recording, but I suppose this is irrelevant to the question.

Here comes my question. When the audio clip has been saved I would like to make some changes to the user interface. How can I do that? Rather than how is when. Is there an event of some sort that I can handle, which will let me know that the data is now saved? (So I then could work on the UI changes I want)

In order to avoid that some consider this as a duplicate question (by reading too fast). I want to point out that I am not trying to make a download (from a server), I am just saving on disk what is present in the RAM (the just recorded voice). There is therefore no need to point me to this link: Detect when user accepts to download a file

Michel
  • 9,353
  • 16
  • 68
  • 152

0 Answers0