I am writing a music software in visual basic as my final year project and am having problems with displaying a piano and loading sounds into each of the notes.Can someone please!!!! come to my aid. Any help given will be appreciated
Here is how you can play wav files.
1. Add a command button and a common dialog box. Copy and paste the sndPlaySound Declare statement from the API Viewer into your application. Also copy the SND_SYNC and SND_ASYNC constants.
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_SYNC = &H0
2. Add this code to the Command1_Click procedure:
Private Sub Command1_Click()
Dim RtnVal As Integer
'Get name of .wav file to play
CommonDialog1.Filter = "Sound Files|*.wav"
RtnVal = sndPlaySound(CommonDialog1.filename, SND_SYNC)