Here is the audio control. When I put the path in browser nothing is showing.
<audio controls="controls">
<source src="E:/Songs/ROCK ON2/Rock On 2/You Know What I Mean(Mr-Jatt.com).mp3" />
</audio>
Here is the audio control. When I put the path in browser nothing is showing.
<audio controls="controls">
<source src="E:/Songs/ROCK ON2/Rock On 2/You Know What I Mean(Mr-Jatt.com).mp3" />
</audio>
You will need to url encode your file path. It doesn't know what to do with the spaces in your file name. So either encode it or remove all the spaces from every part of that path.
If you are trying to play local files you can use <input type="file">
to get file as a File
object and create a Blob URL
of file to set at .src
of <audio>
element at change
event of <input type="file">
element.
<input type="file">
<audio controls></audio>
<script>
var input = document.querySelector("input[type=file]");
var audio = document.querySelector("audio");
input.onchange = function() {
audio.src = URL.createObjectURL(input.files[0]);
}
</script>