20/01/18 11:01
nestor
Salve,
ho creato un programma per registrare l' audio del pc, il problema è che registra dal microfono io vorrei che registra solo i suoni provenienti dagl' autoparlanti il codice è questo:
ho creato un programma per registrare l' audio del pc, il problema è che registra dal microfono io vorrei che registra solo i suoni provenienti dagl' autoparlanti il codice è questo:
Imports System.Runtime.InteropServices Public Class Form1 Private recording As Boolean = False Private file As String Private salva As New SaveFileDialog <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 Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click salva.Filter = "audio mp3(*.mp3)|*.mp3" If salva.ShowDialog = Windows.Forms.DialogResult.OK Then file = salva.FileName End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If recording = False Then If file = "" Then MsgBox("Imposta la directory di destinazione", MsgBoxStyle.Critical) : Exit Sub End If mciSendString("open new Type waveaudio alias recsound", "", 0, 0) mciSendString("record recsound", "", 0, 0) recording = True Button1.Text = "Stop" Else mciSendString("save recsound " & file, "", 0, 0) mciSendString("close recsound", "", 0, 0) recording = False End If End Sub
aaa