moky
moky

Reputation: 29

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

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

Upvotes: 0

Views: 1526

Answers (2)

Anuj Garg
Anuj Garg

Reputation: 582

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>

Upvotes: 0

Denis
Denis

Reputation: 570

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.

Upvotes: 1

Related Questions