HTML5 play local audio file (c:\classical\chopin.wav) in google chrome

1.4k views Asked by At

How to play local audio file (c:\classical\chopin.wav - no file selection) in Google Chrome using HTML5 coding?

2

There are 2 answers

1
Denis On

I'm not on a Windows machine right now. But you should try

<audio src="file:///C:/classical/chopin.wav" controls ></audio>

Of course, this only works, if the webpage is viewed locally on your machine.

1
Anuj Garg On

Keep your audio file in html folder and this code will work.

<audio controls>
  <source src="chopin.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>