Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Vista problem with playing .wav files from C#

Reply
Thread Tools Display Modes

Vista problem with playing .wav files from C#

 
 
rnmalhotra@gmail.com
Guest
Posts: n/a

 
      08-16-2007
Experts,

I have a simple .aspx page that takes a path to a .wav file, and
plays it. This page works fine on all OSs (Windows 2000, Windows 2003,
Windows XP), but not on Vista. Could the protected mode on vista be
interfering with this page? Any other ideas on why the code does not
work on Vista would be greatly appreciated. The (simple) code for this
page is

==========.aspx page========================================
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WavFileTest.aspx.cs" Inherits="MiscTests.WavFileTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Enter File Location: <asp:TextBox ID="WavFileName"
runat="server" />
<asp:Button ID="Play" Text="Play" runat="server"
OnClick="Play_Clicked" />
</div>
</form>
</body>
</html>


======================= .cs code behind
code======================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Media;

namespace MiscTests
{
public partial class WavFileTest : System.Web.UI.Page
{
protected TextBox WavFileName;
protected Button Play;
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Play_Clicked(object sender, System.EventArgs e)
{
try
{

SoundPlayer player = new SoundPlayer();
player.SoundLocation = WavFileName.Text;
player.Load();
player.Play();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
}
================================================== ==========================

Thank you in advance.

Best,

Raj.

 
Reply With Quote
 
 
 
 
Bill Yanaire
Guest
Posts: n/a

 
      08-16-2007
This is 100% the wrong group to post to. You really need to post to one of
the dotnet or C# groups. I'll bet 99.8% of the people here wouldn't
understand the code



<> wrote in message
news: ups.com...
> Experts,
>
> I have a simple .aspx page that takes a path to a .wav file, and
> plays it. This page works fine on all OSs (Windows 2000, Windows 2003,
> Windows XP), but not on Vista. Could the protected mode on vista be
> interfering with this page? Any other ideas on why the code does not
> work on Vista would be greatly appreciated. The (simple) code for this
> page is
>
> ==========.aspx page========================================
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeBehind="WavFileTest.aspx.cs" Inherits="MiscTests.WavFileTest" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> Enter File Location: <asp:TextBox ID="WavFileName"
> runat="server" />
> <asp:Button ID="Play" Text="Play" runat="server"
> OnClick="Play_Clicked" />
> </div>
> </form>
> </body>
> </html>
>
>
> ======================= .cs code behind
> code======================================
> using System;
> using System.Data;
> using System.Configuration;
> using System.Collections;
> using System.Web;
> using System.Web.Security;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.WebControls.WebParts;
> using System.Web.UI.HtmlControls;
> using System.Media;
>
> namespace MiscTests
> {
> public partial class WavFileTest : System.Web.UI.Page
> {
> protected TextBox WavFileName;
> protected Button Play;
> protected void Page_Load(object sender, EventArgs e)
> {
>
> }
> protected void Play_Clicked(object sender, System.EventArgs e)
> {
> try
> {
>
> SoundPlayer player = new SoundPlayer();
> player.SoundLocation = WavFileName.Text;
> player.Load();
> player.Play();
> }
> catch (Exception ex)
> {
> Response.Write(ex.Message);
> }
> }
> }
> }
> ================================================== ==========================
>
> Thank you in advance.
>
> Best,
>
> Raj.
>



 
Reply With Quote
 
Michael Solomon
Guest
Posts: n/a

 
      08-16-2007


<> wrote in message
news: ups.com...
> Experts,
>
> I have a simple .aspx page that takes a path to a .wav file, and
> plays it. This page works fine on all OSs (Windows 2000, Windows 2003,
> Windows XP), but not on Vista. Could the protected mode on vista be
> interfering with this page? Any other ideas on why the code does not
> work on Vista would be greatly appreciated. The (simple) code for this
> page is
>
> ==========.aspx page========================================
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeBehind="WavFileTest.aspx.cs" Inherits="MiscTests.WavFileTest" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> Enter File Location: <asp:TextBox ID="WavFileName"
> runat="server" />
> <asp:Button ID="Play" Text="Play" runat="server"
> OnClick="Play_Clicked" />
> </div>
> </form>
> </body>
> </html>
>
>
> ======================= .cs code behind
> code======================================
> using System;
> using System.Data;
> using System.Configuration;
> using System.Collections;
> using System.Web;
> using System.Web.Security;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.WebControls.WebParts;
> using System.Web.UI.HtmlControls;
> using System.Media;
>
> namespace MiscTests
> {
> public partial class WavFileTest : System.Web.UI.Page
> {
> protected TextBox WavFileName;
> protected Button Play;
> protected void Page_Load(object sender, EventArgs e)
> {
>
> }
> protected void Play_Clicked(object sender, System.EventArgs e)
> {
> try
> {
>
> SoundPlayer player = new SoundPlayer();
> player.SoundLocation = WavFileName.Text;
> player.Load();
> player.Play();
> }
> catch (Exception ex)
> {
> Response.Write(ex.Message);
> }
> }
> }
> }
> ================================================== ==========================
>
> Thank you in advance.
>
> Best,
>
> Raj.
>


You might want to try this on the MSDN Forums:
http://forums.microsoft.com/msdn/default.aspx?siteid=1
--
Michael Solomon
Backup is a PC user's best friend
DTS-L.Org: http://www.dts-l.org/

 
Reply With Quote
 
Mark
Guest
Posts: n/a

 
      08-17-2007
You can turn off Protected Mode under Internet Options.
(It will nag you until you turn it back on, but this should let you test
your theory.)



"" wrote:

> Experts,
>
> I have a simple .aspx page that takes a path to a .wav file, and
> plays it. This page works fine on all OSs (Windows 2000, Windows 2003,
> Windows XP), but not on Vista. Could the protected mode on vista be
> interfering with this page? Any other ideas on why the code does not
> work on Vista would be greatly appreciated. The (simple) code for this
> page is
>
> ==========.aspx page========================================
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeBehind="WavFileTest.aspx.cs" Inherits="MiscTests.WavFileTest" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> Enter File Location: <asp:TextBox ID="WavFileName"
> runat="server" />
> <asp:Button ID="Play" Text="Play" runat="server"
> OnClick="Play_Clicked" />
> </div>
> </form>
> </body>
> </html>
>
>
> ======================= .cs code behind
> code======================================
> using System;
> using System.Data;
> using System.Configuration;
> using System.Collections;
> using System.Web;
> using System.Web.Security;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.WebControls.WebParts;
> using System.Web.UI.HtmlControls;
> using System.Media;
>
> namespace MiscTests
> {
> public partial class WavFileTest : System.Web.UI.Page
> {
> protected TextBox WavFileName;
> protected Button Play;
> protected void Page_Load(object sender, EventArgs e)
> {
>
> }
> protected void Play_Clicked(object sender, System.EventArgs e)
> {
> try
> {
>
> SoundPlayer player = new SoundPlayer();
> player.SoundLocation = WavFileName.Text;
> player.Load();
> player.Play();
> }
> catch (Exception ex)
> {
> Response.Write(ex.Message);
> }
> }
> }
> }
> ================================================== ==========================
>
> Thank you in advance.
>
> Best,
>
> Raj.
>
>

 
Reply With Quote
 
Mark
Guest
Posts: n/a

 
      08-17-2007
You can turn off protected mode under Internet options to test your theory.
(IE will nag you until you turn it back on.)

"" wrote:

> Experts,
>
> I have a simple .aspx page that takes a path to a .wav file, and
> plays it. This page works fine on all OSs (Windows 2000, Windows 2003,
> Windows XP), but not on Vista. Could the protected mode on vista be
> interfering with this page? Any other ideas on why the code does not
> work on Vista would be greatly appreciated. The (simple) code for this
> page is
>
> ==========.aspx page========================================
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeBehind="WavFileTest.aspx.cs" Inherits="MiscTests.WavFileTest" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> Enter File Location: <asp:TextBox ID="WavFileName"
> runat="server" />
> <asp:Button ID="Play" Text="Play" runat="server"
> OnClick="Play_Clicked" />
> </div>
> </form>
> </body>
> </html>
>
>
> ======================= .cs code behind
> code======================================
> using System;
> using System.Data;
> using System.Configuration;
> using System.Collections;
> using System.Web;
> using System.Web.Security;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.WebControls.WebParts;
> using System.Web.UI.HtmlControls;
> using System.Media;
>
> namespace MiscTests
> {
> public partial class WavFileTest : System.Web.UI.Page
> {
> protected TextBox WavFileName;
> protected Button Play;
> protected void Page_Load(object sender, EventArgs e)
> {
>
> }
> protected void Play_Clicked(object sender, System.EventArgs e)
> {
> try
> {
>
> SoundPlayer player = new SoundPlayer();
> player.SoundLocation = WavFileName.Text;
> player.Load();
> player.Play();
> }
> catch (Exception ex)
> {
> Response.Write(ex.Message);
> }
> }
> }
> }
> ================================================== ==========================
>
> Thank you in advance.
>
> Best,
>
> Raj.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing mp4 and divx avi files with Vista Media Center pa1270 Windows Vista General Discussion 2 09-11-2007 02:16 AM
Vista Crashes after approx 1 hour of playing MP3 music files every htguru Windows Vista General Discussion 3 06-28-2007 02:11 AM
Playing WMV files in Vista mitchbryan@hotmail.co.uk Windows Vista General Discussion 1 06-16-2007 11:09 AM
Vista WMP11 & Media Centre - New fault playing WMA/WMV/MP3/AVI files Colin Windows Vista General Discussion 5 04-22-2007 04:39 PM
Problem Playing .wav files in certain Apps. Cody Windows Vista General Discussion 0 07-15-2006 05:16 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59