How to play .wav files in chrome browser

Posted by Kavithav under ASP.NET on 10/30/2016 | Points: 10 | Views : 3994 | Status : [Member] | Replies : 0
I need to develop a web application which converts dss and ds2 files programmatically an d play those converted audio files in all browsers i tried a lot but i could not do it as i am new to this can anyone help me out.

Below is the way which i tried but it is not working in chrome browser.What i did here is i had downloaded switch sound software from NCH Software and converted dss and ds2 files to .wav format.After conversion i need to place those wav files in a folder in my application and i had given the path in this works it works only in firefox browser but not in chrome browser.This is the code that i used.how can i do this such that the files should get played in all browsers

This is the first way i tried

//
$("#audio").attr("autoplay", true);
//document.getElementById("audio").play();//to play
//document.getElementById("audio").pause();//to pause

window.onload = function () { document.getElementById("audio").play(); }
window.addEventListener("load", function () { document.getElementById("audio").play(); });




<%-- <audio src="Sounds/DPM317.wav" controls="controls" autoplay="autoplay">--%>
<%-- <audio src="Sounds/DS250069new.wav" controls="controls" autoplay="autoplay">

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

--%>

<audio id="audio" controls="" autoplay="">
<source src="Sounds/DPM317.wav" type="audio/wav" />
Your browser does not support the audio element.

This is the second way i tried

<title>

function PlaySound(soundobj) {

var thissound = document.getElementById(soundobj);

thissound.play();

}


function PauseSound(soundobj) {

var thissound = document.getElementById(soundobj);

thissound.pause();

}








<audio id="audio1" controls="controls" preload="auto" src="Sounds/DPM317.wav" type="audio/wav">


<audio id="audio2" controls="controls" preload="auto" src="Sounds/DS250069new.wav" type="audio/wav">

But none of them are working in chrome browser can anyone help me out as iam new to this




Responses

(No response found.)

Login to post response