VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



API call for Playing a sound

by Mike-Ejeet 9t9 (5 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

This API call is used to play a .wav file. Hope you enjoy the code. Peace!

API Declarations
This code is all API

Rate API call for Playing a sound

To use this API paste the following code into a module:
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Then to call the API type:
Variable = sndPlaySound (Location, 1)
So for example to play a .wav file located at C:\Sounds\sound.wav type:
Variable = sndPlaySound ("C:\Sounds\sound.wav, 1)

Thats it!


Download this snippet    Add to My Saved Code

API call for Playing a sound Comments

No comments have been posted about API call for Playing a sound. Why not be the first to post a comment about API call for Playing a sound.

Post your comment

Subject:
Message:
0/1000 characters