|
-
Apr 12th, 2001, 03:36 PM
#1
Thread Starter
New Member
ok, utterly stoopid newbie would like to request assistance from all you clever people (creep, creep)
i want to play a short .wav file at various locations in my program. after looking through the API viewer thingy, i guess that i need the "PlaySound" call.
now, i suppose the first argument is the path and name of the file to play?
But what are the second two?
thats about all. thank you
-
Apr 12th, 2001, 03:44 PM
#2
Frenzied Member
Here you are
Code:
Private Const SND_APPLICATION = &H80 ' look for application specific association
Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND_SYNC = &H0 ' play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Form_Load()
PlaySound "C:\WINDOWS\MEDIA\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub
-
Apr 12th, 2001, 03:55 PM
#3
Thread Starter
New Member
Ta very muchly Vlatko
This posting lark aint so scary after all
-
Apr 12th, 2001, 05:37 PM
#4
As for the explanation: The 2nd argument specifies the instance that contains the resource (just set to 0) and the last argument is the flags.
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
|