473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Sound with New System.Media.SoundPlayer()

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
9 7680

"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

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
Try this:

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



Nov 14 '06 #4

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

"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

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

"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

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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: djc | last post by:
what choices do I have to play sounds in a program using vb.net? Or, I guess if nothing vb specific what windows API(s) should I look at? I am interested to find out whats needed for playing short...
4
by: Mateo | last post by:
Hi! does anyone know some good C# or VB.Net library for working with sound? I would need to do the folowing: - take audio file - create small sound distorzion (with some kind of classical...
3
by: Devlei | last post by:
Can someone please point me in the right direction as to how to play system sounds and/or WAV files from a VS.Net 2003 application. I can find plenty of info about how easy it is with VS2005, but...
6
by: Jon B | last post by:
Hi There! How do I play a sound from Windows that get played when a USB device is plug-in or plug out? Many thanks in advance!! Jon
5
by: gazza67 | last post by:
Hi, Does anyone know how to check for when a sound has finished playing? I am currently using the SoundPlayer, there doesnt seem to be any event for this - am I missing something? Gary
2
by: anj2k5 | last post by:
I uploaded music file in SQl DB in a image dataype .But when i try to reterive it,It doesn't play. It gives the following type casting error on runtime "Unable to cast object of type...
1
by: Jone | last post by:
Hello, Is it possible to play wav files slower or faster than the default speed of the SoundPlayer class does? I'm writing a small tool for guitarplayers and one feature would be a...
3
by: Jack | last post by:
Hi, I'm writing a simple wav player (like winamp) and using the SoundPlayer class in c# 2005. Using winform buttons, I can begin playing the sound and stop half-way through the sound using:...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.