Bu derste bilgisayar mikrofonunu kullanarak winmm.dll APIsi ile ses kaydetmeyi öğrenelim.
Kaydı başlat kodu:
Kaydet ve bitir kodu :
Imports System.Runtime.InteropServices
<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
Public Sub Kaydedici(ByVal islem As String, ByVal path As String, ByVal isim As String)
If islem = "baslat" Then mciSendString("open new Type waveaudio Alias recsound", "", 0, 0) mciSendString("record recsound", "", 0, 0) ElseIf islem = "bitir" Then mciSendString("save recsound " & path & "/" & isim & ".wav", "", 0, 0) mciSendString("close recsound ", "", 0, 0) End If End Sub |
Kaydı başlat kodu:
Kaydedici("baslat","","") |
Kaydet ve bitir kodu :
Kaydedici("bitir","C:","ses_kaydi") |
Post A Comment:
0 comments: