By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,641 Members | 1,446 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,641 IT Pros & Developers. It's quick & easy.

Sound with New System.Media.SoundPlayer()

P: n/a
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()

Nov 14 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a

"Roger" <ro*********@hotmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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?


Nov 14 '06 #2

P: n/a

Robinson wrote:
"Roger" <ro*********@hotmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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.

Nov 14 '06 #3

P: n/a
Try this:

My.Computer.Audio.Play(ErrorLocation, AudioPlayMode.Background)



Nov 14 '06 #4

P: n/a

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

Nov 14 '06 #5

P: n/a

"Roger" <ro*********@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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?
Nov 14 '06 #6

P: n/a

Robinson wrote:
"Roger" <ro*********@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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?

Nov 14 '06 #7

P: n/a

"Roger" <ro*********@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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


Nov 14 '06 #8

P: n/a

Robinson wrote:
"Roger" <ro*********@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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 ;-)

Nov 14 '06 #9

P: n/a
"Robinson" <to******************@myinboxtoomuchtoooften.comsc hrieb:
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/>

Nov 15 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.