I am trying to create a function in which an mp3 file is pulled from
<input type="file" id="sound" accept="audio/*"/>
and stored in localStorage in Chrome. (I know that localStorage is limited in size, but the audio files that I will work with will be under 2 MB.) Once this audio file is saved, it will play using:
var audio = new Audio('audioFile');
audio.play();
I'm still new to web development, so any pointers would be great!
NOTE. This is not a duplicate of HTML5 audio recordings in a file . I am trying to take an existing mp3 file from my hard drive and save it to localStorage so that it can be played.
source
share