Sound with New System.Media.SoundPlayer()

  • Thread starter Thread starter Roger
  • Start date Start date
R

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()
 
Roger said:
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?
 
Robinson said:
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.
 
Robinson said:
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
 
Roger said:
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?
 
Roger said:
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
 
Robinson said:
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 ;-)
 
Robinson said:
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.
 
Back
Top