VB icon

[ 3 lines of codes ]

Email
Submitted on: 2/10/2015 8:43:00 PM
By: Power Of Anubis (from psc cd)  
Level: Beginner
User Rating: By 12 Users
Compatibility: VB 6.0
Views: 2823
 
     Play a wave file with only 3 lines of codes! It works with .wav files 100%, with other extension I don't know. Try and then report.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: [ 3 lines of codes ]
' Description:Play a wave file with only 3 lines of codes!
It works with .wav files 100%, with other extension I don't know. Try and then report.
' By: Power Of Anubis (from psc cd)
'**************************************

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
'----------PLAY WAVE SOUND--------
Private Sub PlayWaveSound_Click()
 soundfile$ = "c:/TheCustomSoundIWant.wav"
 wFlags% = SND_ASYNC Or SND_NODEFAULT
 HaHa = sndPlaySound(soundfile$, wFlags%)
End Sub
'-------STOP WAVE SOUND-------
Private Sub StopTheSound_Click()
StopTheSoundNOW = sndPlaySound(soundfile$, wFlags%)
End Sub
'Replace "c:/TheCustomSoundIWant.wav" with your sound


Other 6 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.