Sound Recorder
______________________________________________________________________________
Public Class Recorder
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstycommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Button1.Enabled = False
Button2.Enabled = True
Button3.Enabled = False
Label2.Text = 0
Label1.Text = "Recording!!"
mciSendString("open new type waveaudio Alias recsound", "", 0, 0)
mciSendString("record recsound", "", 0, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
Button1.Enabled = True
Button2.Enabled = False
Button3.Enabled = True
Label1.Text = "Stopped!!"
mciSendString("Save recsound c:\recsound.wav", "", 0, 0)
MsgBox("File Created:C:\recsound.wav")
Label1.Text = "Stopped"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label1.Text = "Playing"
Label1.Visible = True
AxWindowsMediaPlayer1.URL = "C:\recsound.wav"
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label2.Text = Label2.Text + 1
If Label2.Text > 59 Then
Label3.Text = Label3.Text + 1
Label2.Text = 0
End If
End Sub
End Class
_________________________________________________________
Coding, Programming examples using amazing small applications only for educational purpose.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment