VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make Your OwnWAVPlayer

by Matt Evans (6 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

This is the code to *PLAY*, *STOP*, and *LOOP* WAV files. Its really easy! even for a beginner! You can make your own WAV Player!

API Declarations
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_MEMORY = &H4
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10

Rate Make Your OwnWAVPlayer

Sub WAVStop()
Call WAVPlay(" ")
End Sub
Sub WAVLoop(File)
Dim SoundName As String
SoundName$ = File
wFlags% = SND_ASYNC Or SND_LOOP
X = sndPlaySound(SoundName$, wFlags%)
End Sub
Sub WAVPlay(File)
Dim SoundName As String
SoundName$ = File
wFlags% = SND_ASYNC Or SND_NODEFAULT
X = sndPlaySound(SoundName$, wFlags%)
End Sub

Download this snippet    Add to My Saved Code

Make Your OwnWAVPlayer Comments

No comments have been posted about Make Your OwnWAVPlayer. Why not be the first to post a comment about Make Your OwnWAVPlayer.

Post your comment

Subject:
Message:
0/1000 characters