|
-
May 28th, 2000, 11:59 PM
#1
Thread Starter
New Member
-
May 29th, 2000, 12:42 AM
#2
Create a Resource File and add the WAV(s) to it with meaning full ID's, then use a modified version of the sndPlaySound() API to play them from memory, after loading the Resource WAV into a Binary Array, i.e.
Code:
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Sub Command1_Click()
Dim vSnd() As Byte
vSnd = LoadResData("SOUND1", "CUSTOM")
Call sndPlaySound(vSnd(0), SND_MEMORY Or SND_ASYNC)
End Sub
Regards,
- Aaron.
-
May 29th, 2000, 12:49 AM
#3
playing the file, requires API
Code:
PlaySound "c:\my documents\Genflit0.wav", 0, d
DoEvents
I didnt exactly know what to put for the last option, so I just put an empty variable
this will work, but first put this in a module
Code:
Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Type WAVEFORMAT
wFormatTag As Integer
nChannels As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
End Type
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
|