This may have been answered before i am not sure, i am running Visual Studio 2005 beta, i would like to know how i can play a sound file in the background when someone opens a form. Any ideas
I am using the my.computer.audio.play function to play an alert.
The alert is the result of checking a database for new entries every 10 seconds. If there is a new entry that the software has not seen yet, it uses the VBPower Tools Notification Window to pop-up a message.
What I want this to do is play the audio at that same time.
My problem is, I am unable to get audio to play inside of a timer's tick event handler.
Does anyone have any suggestions on how I can get audio to kick off inside that routine
I'm not able to find a reference to this myself, but this is a good question. How do you create a system event sound in windows and then invoke it What's more efficient for playing a wav with your application...invoking a system event sound or just doing the my.computer.audio.play
Sorry to be a annoying, But do you know how i can stop the sound from playing when i make the form visible = false i haven't been able to work that part out yet!
I'm not able to find a reference to this myself, but this is a good question. How do you create a system event sound in windows and then invoke it What's more efficient for playing a wav with your application...invoking a system event sound or just doing the my.computer.audio.play
i have followed the link but there are no mention of anything to download or anything like that. I have tried some of the coding found of the page, for example
yeah sorry about that, i have recently solved it, but thank you very much if you hadn't had given the small snippet of code i would be still wondering about it. Thanks!
stop the audio when the form visibility changes to hidden then something like this should work.
[code language=
"vb"]
Private
Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged If Me.Visible = False Then My.Computer.Audio.Stop() End If
End
Sub
[/code]
For
course if your using another approach to playing the audio (using the
System.Media.SoundPlayer) you can put
in the stop method line in place of the my.computer.audio.stop method.
Playing a sound file
pittaman
say i have a wav file in my documents
what do i place in the brackets between s.load() and s.play()
Sorry i am completely new to this level of coding!
Phil Seastrand
I am using the my.computer.audio.play function to play an alert.
The alert is the result of checking a database for new entries every 10 seconds. If there is a new entry that the software has not seen yet, it uses the VBPower Tools Notification Window to pop-up a message.
What I want this to do is play the audio at that same time.
My problem is, I am unable to get audio to play inside of a timer's tick event handler.
Does anyone have any suggestions on how I can get audio to kick off inside that routine
Thanks!
Chris
Kandikan
What about System.Media.
SystemSounds.Beep.Play();or just System.Media.SystemSounds.Beep() in VB
Craig Shaughnessy
kowalsky
I'm not able to find a reference to this myself, but this is a good question. How do you create a system event sound in windows and then invoke it What's more efficient for playing a wav with your application...invoking a system event sound or just doing the my.computer.audio.play
Thanks
Ted Wagner
http://www.trwagner.org
http://www.hanggup.com
enuffznuff
What error message do you get Keep in mind that SoundPlayer only supports wav files, no mp3...
uconnbizniss
But do you know how i can stop the sound from playing when i make the form visible = false
i haven't been able to work that part out yet!
chrisj
media.soundplayer
i may be typing something wrong i don't any help would be good!
Error 1 'SoundPlayer' is a type in 'Media' and cannot be used as an expression
Rusi Hilloowala
http://forums.microsoft.com/msdn/ShowPost.aspx PostID=50999
footballism
Dim s As New System.Media.SoundPlayer(filename)
s.Load()
s.Play()
Ensynch
Think I found it:
My
.Computer.Audio.PlaySystemSound()Ted Wagnerhttp://www.trwagner.org
http://www.hanggup.com
Ivan S
media.soundplayer
but it always returns an error message
Debasish Bose
Thanks!
Andrew
Visio User
VB.NET 2005
Top play an audio file. Extremely simple
using the new My functionality.My
.Computer.Audio.Play("c:\windows\media\chime.wav")My
.Computer.Audio.Stop()To
stop the audio when the form visibility changes to hidden then something like this should work.[code language=
"vb"]Private
Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged If Me.Visible = False Then My.Computer.Audio.Stop() End IfEnd
Sub[/code]
For
course if your using another approach to playing the audio (using theSystem.Media.SoundPlayer) you can put
in the stop method line in place of the my.computer.audio.stop method.