Using local file as src

I can think of two ways.

Within your audio tag:

src="https://stackoverflow.com/questions/21737224/file:///C:/.file.mp3"

or you could use a Blob using the file API.

HTML:

<input type="file"></input>

JS:

audio.src = URL.createObjectURL(document.getElementsByTagName('input')[0].files[0]);

Leave a Comment