Да спасибо я нашел. Ниже что получилось. Может кто знает есть ли готовый класс?
-
- Public Class Form1
-
- 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 Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim Result As Long
- Result = mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
- result = mciSendString("record recsound", "", 0, 0)
- End Sub
-
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim Result As Long
- Result = mciSendString("save recsound c:\\record.wav", "", 0, 0)
- Result = mciSendString("close recsound ", "", 0, 0)
- My.Computer.Audio.Stop()
-
- End Sub
-
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- My.Computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background)
- End Sub
- End Class
Ответить
|