MoshMosh
MoshMosh

Reputation: 71

How to play wav file in explorer with javascript

I'm searching for a way to play wav files in my web app that will support internet explorer but cannot find a way to play wav in explorer - anyone figure out how to do it? (without silverlight)

Upvotes: 0

Views: 2707

Answers (2)

Taufiq Rahman
Taufiq Rahman

Reputation: 5714

Internet explorer does not support wav-files using the HTML5 audio-tag. 1)You can try an embed tag:

<embed src="path/mywav.wav" autostart=false width=1 height=1 id="wavfile"
        enablejavascript="true">

2)Or you can try howler.js. A modern web audio js library.

3)Or you can simply try :

var audio = new Audio('audio_file.wav');
audio.play();

Upvotes: 1

Hamid Reza Ebrahimi
Hamid Reza Ebrahimi

Reputation: 151

use the Audio element:

    var audio = new Audio('c:\\w1.wav');
    audio.play();

Upvotes: 3

Related Questions