int id = Convert.ToInt32(Request.QueryString["Id"]);
conObj = new SqlConnection(conString);
conObj.Open();
cmd = new SqlCommand("Select * from NMP_Page_Content where NMP_Image_ID='" + id + "'", conObj);
tableObj = new DataTable();
adapterObj = new SqlDataAdapter(cmd);
adapterObj.Fill(tableObj);
audioFilePath = tableObj.Rows[0]["NMP_Image_File_Path"].ToString();
SoundPlayer mplayer = new SoundPlayer();
mplayer.SoundLocation = audioFilePath;
mplayer.Play();
I got this exception
The wave header is corrupt.
what would be the problem.. reply plz
Follow Me @GaneshAtkale MARK AS ANSWER, if my post helps you...
Thanks & Regards
Ganesh Atkale .
GaneshAtkale
Member
514 Points
399 Posts
to play Audio (.mp3) file what to do in asp.net
Apr 26, 2012 11:24 AM|LINK
Hi........,
I have written following code
int id = Convert.ToInt32(Request.QueryString["Id"]); conObj = new SqlConnection(conString); conObj.Open(); cmd = new SqlCommand("Select * from NMP_Page_Content where NMP_Image_ID='" + id + "'", conObj); tableObj = new DataTable(); adapterObj = new SqlDataAdapter(cmd); adapterObj.Fill(tableObj); audioFilePath = tableObj.Rows[0]["NMP_Image_File_Path"].ToString(); SoundPlayer mplayer = new SoundPlayer(); mplayer.SoundLocation = audioFilePath; mplayer.Play();I got this exception
The wave header is corrupt.
what would be the problem.. reply plz
MARK AS ANSWER, if my post helps you...
Thanks & Regards
Ganesh Atkale .
somnathmali
Contributor
2816 Points
450 Posts
Re: to play Audio (.mp3) file what to do in asp.net
Apr 26, 2012 11:28 AM|LINK
audioFilePath should be "Browsable" .. means it should be absolute url.
.NET Developer , Pune INDIA.
Please Mark As Answer If my reply helped you.
GaneshAtkale
Member
514 Points
399 Posts
Re: to play Audio (.mp3) file what to do in asp.net
Apr 26, 2012 11:32 AM|LINK
URL is correct. I have checked it run time..
kindly reply anybody
MARK AS ANSWER, if my post helps you...
Thanks & Regards
Ganesh Atkale .
Hayam Rady
Member
38 Points
10 Posts
Re: to play Audio (.mp3) file what to do in asp.net
Apr 26, 2012 12:27 PM|LINK
http://www.w3schools.com/html5/tag_audio.asp
GaneshAtkale
Member
514 Points
399 Posts
Re: to play Audio (.mp3) file what to do in asp.net
May 16, 2012 09:14 AM|LINK
yup after making it as brawseble, I have add MIME TYPE @ IIS..
Thanx For reply
MARK AS ANSWER, if my post helps you...
Thanks & Regards
Ganesh Atkale .