Attribute VB_Name = "ModWave"
'===================================================================
'=============================Mr.3amo الحقوق محفوظة لاهلها عمو=========
'===================================================================
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA" (ByVal lpFileName As String) As Long
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Public Function Start_Recording(channels As String, Frequency As String, bits As String)
    i = mciSendString("close all", 0&, 0, 0)
    i = mciSendString("open new type waveaudio alias capture", 0&, 0, 0)
    i = mciSendString(channels, 0&, 0, 0)
    i = mciSendString("seek capture to start", 0&, 0, 0)
    i = mciSendString(Frequency, 0&, 0, 0)
    i = mciSendString(bits, 0&, 0, 0)
    i = mciSendString("record capture", 0&, 0, 0)
End Function
Public Sub Stop_Recording()
    i = mciSendString("stop capture", 0&, 0, 0)
End Sub

Public Function Save_Recording(MyPath As String)
    i = mciSendString("save capture " & """" & MyPath & """", 0&, 0, 0)
    DoEvents
    i = mciSendString("close all", 0&, 0, 0)
End Function

