|
-
May 10th, 2005, 02:39 AM
#1
Thread Starter
Lively Member
Hovering sounds...
OK, now I have a label which I have assigned the MouseHover Declaration onto. What I want to achive, is to get a sound to play on the event and to stop playing on the MouseLeave event. The sound is electricity and I have an animated shocking title which I have placed the label over. So it would be good if it could loop on the event. The trouble is, I don't know how to get it to play. I put the wav into the Solution Explorer and I wonder if I could call it or something from there, but I don't know where to start.
Thanks in adavance.
-
May 10th, 2005, 03:52 AM
#2
Re: Hovering sounds...
VB Code:
Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
This API function will let you play a Wav file. Check this link for details of its parameters: http://www.mentalis.org/apilist/PlaySound.shtml
I don't live here any more.
-
May 10th, 2005, 04:09 PM
#3
Thread Starter
Lively Member
Re: Hovering sounds...
I can't get it to work, let alone understand it. Now I tried to see If I could use DirectX's sound thingy to play it for me. I think this would be overkill as all I need is to play one small wav, but right now, I'm willing to try anything. I tried this:
But there is no DirectX under Windows name. I even tried this:
VB Code:
Imports System
Imports DxVBLib
' Then in a Public Class ---
Private use_dx As DirectX
Private use_ds As DirectSound
' There's the problem ---
So 'DirectX' and 'DirectSound' is not "Defined" and won't work but it should take it from DxVBLib but that apparently doesn't exist either. What am I doing wrong? Oh and If anyone can offer an easier and better suggetion, please do, becuase this DirectX stuff is confusing, API is less coding too
-
May 10th, 2005, 04:35 PM
#4
Re: Hovering sounds...
Well, first you have to have reference to the DirectX library before it can be imported. Once you set the reference, you should be able to have access to it's objects.
Tg
-
May 10th, 2005, 04:45 PM
#5
Thread Starter
Lively Member
Re: Hovering sounds...
How do I set the reference?
(Btw, I'm going to scool now so I won't reply straight away)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|