help me I want to make a program that record mic in vb.net I got this code but I cant save audio on different location
Imports System.Runtime.InteropServices
Public Class Form1
'Dim recording As Boolean = False
Dim Filez As String = "C:\rec.mp3"
<DllImport("winmm.dll")>
Private Shared Function mciSendString(ByVal command As String, ByVal buffer As String, ByVal bufferSize As Integer, ByVal hwndCallback As IntPtr) As Integer
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
mciSendString("record recsound", "", 0, 0)
Button1.Text = "Stop"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
My.Computer.Audio.Play(Filez)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
mciSendString("save recsound " & Filez, "", 0, 0)
mciSendString("close recsound ", "", 0, 0)
Button2.Enabled = True
End Sub
End Class
When i change path of Filez for save at another place it show error
Please help