Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
- Private Sub btnRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRecord.Click
- btnRecord.Enabled = False
- btnStop.Enabled = True
- mciSendString("open new Type waveaudio Alias hrsSound", "", 9, 9)
- mciSendString("record hrsSound", "", 9, 9)
- Label1.Text = "Recording..."
- Label1.Visible = True
- End Sub
- Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
- btnRecord.Enabled = True
- btnStop.Enabled = False
- btnPlay.Enabled = True
- mciSendString("save hrsSound d:\mySound.mp3", "", 9, 9)
- mciSendString("close hrsSound", "", 0, 0)
- MsgBox("File Created: d:\mySound.mp3")
- Label1.Text = "Stopped..."
- Label1.Visible = False
- End Sub
- Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
- Label1.Text = "Playing..."
- Label1.Visible = True
- My.Computer.Audio.Play("d:\mySound.mp3", AudioPlayMode.Background)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement