DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 16 Aug 2007 16:07:45 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown
          2    George Ter-Saakov
          3    Raj
                 4    George Ter-Saakov


Vista problem with playing .wav files from C#   
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.
Date:Thu, 16 Aug 2007 16:07:45 -0000   Author:  

Re: Vista problem with playing .wav files from C#   
You doing it wrong.
You playing it on the server. Why do you want to do that. It works for you 
only because you are sitting in the same room where server is :)


George.


 wrote in message 
news:1187280465.554277.261640@a39g2000hsc.googlegroups.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.
> 
Date:Thu, 16 Aug 2007 12:59:44 -0400   Author:  

Re: Vista problem with playing .wav files from C#   
George,

    Thanks for the note. That is the intent, becuase the client and
the server are always on the same machine. Any ideas on why it doesn't
work on Vista?

Best,
Raj.

On Aug 16, 12:59 pm, "George Ter-Saakov"  wrote:

> You doing it wrong.
> You playing it on the server. Why do you want to do that. It works for you
> only because you are sitting in the same room where server is :)
>
> George.
>
>  wrote in message
>
> news:1187280465.554277.261640@a39g2000hsc.googlegroups.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.- Hide quoted text -
>
> - Show quoted text -
Date:Thu, 16 Aug 2007 18:39:58 -0000   Author:  

Re: Vista problem with playing .wav files from C#   
My educated guess would be that IIS does not have access to talk to 
speakers. Most likely it needs some elevated permissions to use the 
hardware.

George.


"Raj"  wrote in message 
news:1187289598.459537.41910@g4g2000hsf.googlegroups.com...
George,

    Thanks for the note. That is the intent, becuase the client and
the server are always on the same machine. Any ideas on why it doesn't
work on Vista?

Best,
Raj.

On Aug 16, 12:59 pm, "George Ter-Saakov"  wrote:

> You doing it wrong.
> You playing it on the server. Why do you want to do that. It works for you
> only because you are sitting in the same room where server is :)
>
> George.
>
>  wrote in message
>
> news:1187280465.554277.261640@a39g2000hsc.googlegroups.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.- Hide quoted text -
>
> - Show quoted text -
Date:Thu, 16 Aug 2007 15:28:35 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us