Bonjour,
Comment est-il possible d'enregistrer un son WAV ou mieux MP3 avec VB.NET ?
Merci pour votre aide.
Bonjour,
Comment est-il possible d'enregistrer un son WAV ou mieux MP3 avec VB.NET ?
Merci pour votre aide.
Ce code fonctionne :
Private Declare Function ReleaseCapture Lib "user32" () As Integer
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Integer) As Integer
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Private Const HTCAPTION As Integer = 2
Private Const WM_NCLBUTTONDOWN As Integer = &HA1S
Private Const CS_NOCLOSE As Integer = &H200
Public x As Int32 = 0
Private Sub record()
'record from microphone
mciSendString("open new Type waveaudio Alias recsound", vbNullString, 0, 0)
mciSendString("record recsound", vbNullString, 0, 0)
End Sub
Private Sub StopSave()
'stop and save
mciSendString("save recsound myfile", vbNullString, 0, 0)
mciSendString("close recsound", vbNullString, 0, 0)
End Sub
Ton code fonctionne en effet, mais au cas ou tu ne l'auras pas testé, la qualitée d'enregistrement est vraiment mauvaise. Saurais tu comment l'améliorer ?
Partager