Home All Groups Group Topic Archive Search About

Sound with New System.Media.SoundPlayer()

Author
14 Nov 2006 2:30 PM
Roger
When I run the following code it does not play on the client. When the
server and client are on the same machine it plays??? Any help from
anyone???

Dim errorSound As New System.Media.SoundPlayer()
  errorSound.SoundLocation = ErrorLocation
  errorSound.Load()
  errorSound.Play()

Author
14 Nov 2006 2:44 PM
Robinson
"Roger" <roger_ow***@hotmail.com> wrote in message
news:1163514649.300014.50400@m7g2000cwm.googlegroups.com...
> When I run the following code it does not play on the client. When the
> server and client are on the same machine it plays??? Any help from
> anyone???
>
> Dim errorSound As New System.Media.SoundPlayer()
>  errorSound.SoundLocation = ErrorLocation
>  errorSound.Load()
>  errorSound.Play()

Hi,

What is the content of ErrorLocation when you are on your server and on the
client?
Author
14 Nov 2006 2:53 PM
Roger
Robinson wrote:
Show quoteHide quote
> "Roger" <roger_ow***@hotmail.com> wrote in message
> news:1163514649.300014.50400@m7g2000cwm.googlegroups.com...
> > When I run the following code it does not play on the client. When the
> > server and client are on the same machine it plays??? Any help from
> > anyone???
> >
> > Dim errorSound As New System.Media.SoundPlayer()
> >  errorSound.SoundLocation = ErrorLocation
> >  errorSound.Load()
> >  errorSound.Play()
>
> Hi,
>
> What is the content of ErrorLocation when you are on your server and on the
> client?

Client: "C:\Websites\TimeSheets\wavs\compute.wav"

Server: "F:\Intranet\Applications\TimeSheets\wavs\compute.wav"

I get no errors on both, just no sound from the server, so it is
finding the wav file on the server. I know becuase I got errors with
different paths before on the server.
Author
14 Nov 2006 3:05 PM
Robinson
Try this:

My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)
Author
14 Nov 2006 3:24 PM
Roger
Robinson wrote:
> Try this:
>
> My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)

Thanks for your help but I get a message somthing like Audio is not a
member of My.Computer. How can I get it to be a member?

Thanks,
Roger
Author
14 Nov 2006 3:45 PM
Robinson
Show quote Hide quote
"Roger" <roger_ow***@hotmail.com> wrote in message
news:1163517843.626460.188270@b28g2000cwb.googlegroups.com...
>
> Robinson wrote:
>> Try this:
>>
>> My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)
>
> Thanks for your help but I get a message somthing like Audio is not a
> member of My.Computer. How can I get it to be a member?
>
> Thanks,
> Roger
>

What version of Visual Studio/.NET are you working with?
Author
14 Nov 2006 3:52 PM
Roger
Robinson wrote:
Show quoteHide quote
> "Roger" <roger_ow***@hotmail.com> wrote in message
> news:1163517843.626460.188270@b28g2000cwb.googlegroups.com...
> >
> > Robinson wrote:
> >> Try this:
> >>
> >> My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)
> >
> > Thanks for your help but I get a message somthing like Audio is not a
> > member of My.Computer. How can I get it to be a member?
> >
> > Thanks,
> > Roger
> >
>
> What version of Visual Studio/.NET are you working with?

Visual Studio 2005 Professional Edition, Is there a way to add audio to
My.Computer?
Author
14 Nov 2006 3:50 PM
Robinson
Show quote Hide quote
"Roger" <roger_ow***@hotmail.com> wrote in message
news:1163517843.626460.188270@b28g2000cwb.googlegroups.com...
>
> Robinson wrote:
>> Try this:
>>
>> My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)
>
> Thanks for your help but I get a message somthing like Audio is not a
> member of My.Computer. How can I get it to be a member?
>
> Thanks,
> Roger
>

Ahhh is this a website or a web control library?  My.Computer.Audio isn't
available in those kinds of project.  If this is a web site, you need to
specify a URL, rather than a file path ( I suspect ) with your media player
control, possibly file:\\\myserver\bla\bla\bla or similar).  I have not much
experience of ASP.NET, so others might be able to confirm.


Robin
Author
14 Nov 2006 4:29 PM
Roger
Robinson wrote:
Show quoteHide quote
> "Roger" <roger_ow***@hotmail.com> wrote in message
> news:1163517843.626460.188270@b28g2000cwb.googlegroups.com...
> >
> > Robinson wrote:
> >> Try this:
> >>
> >> My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)
> >
> > Thanks for your help but I get a message somthing like Audio is not a
> > member of My.Computer. How can I get it to be a member?
> >
> > Thanks,
> > Roger
> >
>
> Ahhh is this a website or a web control library?  My.Computer.Audio isn't
> available in those kinds of project.  If this is a web site, you need to
> specify a URL, rather than a file path ( I suspect ) with your media player
> control, possibly file:\\\myserver\bla\bla\bla or similar).  I have not much
> experience of ASP.NET, so others might be able to confirm.
>
>
> Robin

Thanks for your help! I tried a URL but it still does not work, no
sound on the client machine????

Roger ;-)
Author
15 Nov 2006 1:54 AM
Herfried K. Wagner [MVP]
"Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> schrieb:
> Ahhh is this a website or a web control library?  My.Computer.Audio isn't
> available in those kinds of project.  If this is a web site, you need to
> specify a URL, rather than a file path ( I suspect ) with your media
> player control, possibly file:\\\myserver\bla\bla\bla or similar).  I have
> not much experience of ASP.NET, so others might be able to confirm.

I don't think the mentioned methods ('SoundPlayer' and 'My.Audio.Play') are
intended for use in Web applications.  In both cases the sound will be
played on the server and not on the client.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>