프로그래밍언어/VB.NET

VB.NET Wav 파일로 녹음

부산딸랑이 2014. 6. 12. 12:34

Imports System.Runtime.InteropServices

Public Class Form1


    <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(sender As Object, e As EventArgs) Handles Button1.Click
        mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
        mciSendString("record recsound", "", 0, 0)
    End Sub


    '저장
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        mciSendString("save recsound " & Chr(34) & "c:\test.wav" & Chr(34), "", 0, 0) 'chr(34) = "
        mciSendString("close recsound", "", 0, 0)
    End Sub
End Class

'프로그래밍언어 > VB.NET' 카테고리의 다른 글

VB.NET 윈도우폼 이벤트 순서  (0) 2014.06.12
VB.NET 크로스스레딩 컨트롤 함수  (0) 2014.06.12
VB.NET 마우스후킹  (0) 2014.06.11
피카사 api-1  (0) 2014.05.29
For 병렬 Parallel.For  (0) 2014.05.29