Question[Help]voice recorder[Solved]

Posts 14 of 4 · Page 1 of 1
[Help]voice recorder[Solved]
can someone give me a code for a voice recoreder
MSDN Standard API's

[php]
' In namspace add
Imports Microsoft.VisualBasic.Devices
Imports Microsoft.VisualBasic
Imports System.Runtime.InteropServices

'Above Public Class Form1 ' FormName
' This will allow you to use api access on winmm.dll
<DllImport("winmm.dll", EntryPoint:="mciSendStringA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function mciSendString(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
End Function


'This code can go in a button or form load, or whatever event you want to trigger the recording

mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
mciSendString("record recsound", "", 0, 0)



' Save The Sound File as a wav called test123 in the location c:\test\

mciSendString("save recsound c:\test\test123.wav", "", 0, 0)
mciSendString("close recsound ", "", 0, 0)
Dim Comp1 As New Computer()
Comp.Audio.[Stop]()

' Play Back the File
Dim Comp2 As New Computer()
Comp2.Audio.Play("c:\test\test123.wav", AudioPlayMode.Background)

[/php]


You can also create a function for each to keep code clean and allow you to change names etc.


Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?