Hallo ich wollte gerade mal ein Tutorial wir ihr eine Sprachaufzeichnung macht.
Das ganz ist eigentlich recht Simpel!
Ihr braucht:
-Visual Basic min.2008
-Form
-2 Textboxen
-3 Buttons
-Folderbrowserdialog
Das wars!
In der Textbox1 soll der Dateispeicherort rein kommen
eiso den Button darunter damit ihr den Folderbrowserdialog öffnen könnt und somit
dann den Speicherort als Text in die Textbox1 bringt.
In der Textbox2 soll der Name der Datei reingeschrieben werden
Button 2 ist um die Aufnahme zu beginnen.
Button 3 um die Aufnahme zu beenden.
Ihr könnt ja Start und Stop reinschreiben oder so
Jetzt zum Programmieren:
Am Anfang macht ihr noch eine Funktion und Dim´s geregt unter Public Class Form1
Als erstes Programmieren wir den Öffnen des Folderbrowserdialog Buttons:
Dann den Aufnahme Start Button:
Dannach den Stop Button:
Falls jemand Faul ist kann er auch den Code hier Komplett haben:
Spoiler anzeigen
Das war der Teil mit dem Programmieren!
Das War das Tutorial ich hoffe es gefällt euch und ihr könnt was damit anfangen.
Über Feedback usw. Freue ich mich wie immer!
Mfg GMT
Das ganz ist eigentlich recht Simpel!
Ihr braucht:
-Visual Basic min.2008
-Form
-2 Textboxen
-3 Buttons
-Folderbrowserdialog
Das wars!
In der Textbox1 soll der Dateispeicherort rein kommen
eiso den Button darunter damit ihr den Folderbrowserdialog öffnen könnt und somit
dann den Speicherort als Text in die Textbox1 bringt.
In der Textbox2 soll der Name der Datei reingeschrieben werden
Button 2 ist um die Aufnahme zu beginnen.
Button 3 um die Aufnahme zu beenden.
Ihr könnt ja Start und Stop reinschreiben oder so
Jetzt zum Programmieren:
Am Anfang macht ihr noch eine Funktion und Dim´s geregt unter Public Class Form1
Als erstes Programmieren wir den Öffnen des Folderbrowserdialog Buttons:
Dann den Aufnahme Start Button:
VB.NET-Quellcode
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- returnstring = New String(" ", 128)
- Call mciSendString("Open New Type waveaudio Alias capture", returnstring, 128, callback)
- Call mciSendString("record capture", returnstring, 128, callback)
- End Sub
Dannach den Stop Button:
VB.NET-Quellcode
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim aufnahmepfad As String = TextBox1.Text + "\" + TextBox2.Text + ".wav"
- Call mciSendString("Stop capture", returnstring, 128, callback)
- Call mciSendString("save capture " & aufnahmepfad, returnstring, 128, callback)
- Call mciSendString("Close capture", returnstring, 128, callback)
- End Sub
Falls jemand Faul ist kann er auch den Code hier Komplett haben:
VB.NET-Quellcode
- Public Class Form1
- Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal Command As String, ByVal Returnstring As String, ByVal returnlength As Integer, ByVal callback As Integer) As Integer
- Dim returnstring As String
- Dim callback As Integer
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- FolderBrowserDialog1.ShowDialog()
- TextBox1.Text = (FolderBrowserDialog1.SelectedPath)
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- returnstring = New String(" ", 128)
- Call mciSendString("Open New Type waveaudio Alias capture", returnstring, 128, callback)
- Call mciSendString("record capture", returnstring, 128, callback)
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim aufnahmepfad As String = TextBox1.Text + "\" + TextBox2.Text + ".wav"
- Call mciSendString("Stop capture", returnstring, 128, callback)
- Call mciSendString("save capture " & aufnahmepfad, returnstring, 128, callback)
- Call mciSendString("Close capture", returnstring, 128, callback)
- End Sub
- End Class
Das war der Teil mit dem Programmieren!
Das War das Tutorial ich hoffe es gefällt euch und ihr könnt was damit anfangen.
Über Feedback usw. Freue ich mich wie immer!
Mfg GMT