|
-
Feb 11th, 2001, 10:21 AM
#1
Thread Starter
Member
how can I change the beep sound? that is, suppose I have a code like this:
Code:
sub command1_click()
beep
end sub
and I want to change the sound of beeping to another wav file, what should I do? thanks!!
Please Visit My WebCam!!
http://www.hmcheung.com
-
Feb 11th, 2001, 10:26 AM
#2
PowerPoster
Use PlaySound API will do.
Code:
Option Explicit "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_SYNC = &H0 ' Play synchronously (default).
Private Const SND_ASYNC = &H1 ' Play asynchronously (see note below).
Private Const SND_NODEFAULT = &H2 ' Do not use default sound.
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file.
Private Const SND_LOOP = &H8 ' Loop the sound until next sndPlaySound.
Private Const SND_NOSTOP = &H10 ' Do not stop any currently playing sound.
Private Sub Form_Load()
PlaySound "C:\welcome.wav", 0&, SND_ASYNC Or SND_NODEFAULT
End Sub
Last edited by Chris; Feb 11th, 2001 at 10:30 AM.
-
Feb 11th, 2001, 10:27 AM
#3
Frenzied Member
Use the Beep API:
This will sound an 800 Hz tone for 1 sec.
Code:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Form_Load()
Beep 800, 1000
End Sub
-
Feb 11th, 2001, 10:31 AM
#4
PowerPoster
CyberCarsten, Beep API ony work for WinNT or Win2K platform
-
Feb 11th, 2001, 10:36 AM
#5
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
|