|
-
Mar 21st, 2002, 10:34 PM
#1
Thread Starter
Lively Member
playing sounds
Im a new in making games.
So please help me out.
Here is the question:
How do i play a sound when triggered by an event ?
and
How the hell do i attach a sound file into my form so that it will be inside the exe file ?
Hmmm....do i sound like an idiot ?
Oh by the way, can i play mp3 files ?
-
Mar 21st, 2002, 11:07 PM
#2
you can play a wav with this api call:
VB Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_FILENAME = &H20000
Private Sub Command1_Click()
Dim retval As Long
retval = PlaySound("C:\anna.wav", 0, SND_FILENAME Or SND_ASYNC Or SND_NODEFAULT)
End Sub
click here if you need more information about this call
>Oh by the way, can i play mp3 files ?
with this api call i think u cant, you will need a mp3 player dll or something...
R,
Jim.
-
Mar 22nd, 2002, 03:12 AM
#3
Thread Starter
Lively Member
can u please explain what are these for ?
SND_ASYNC = &H1
SND_NODEFAULT = &H2
SND_FILENAME = &H20000
Thanks for the help.
-
Mar 22nd, 2002, 04:01 AM
#4
Thread Starter
Lively Member
ooops
didnt see the link.
Anyone knows how to store the file in the exe file ?
-
Mar 22nd, 2002, 09:53 AM
#5
man i think u cant.. try to make a resource file...
-
Mar 24th, 2002, 09:40 AM
#6
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
|