Mal wieder Hallo und einen schönen guten Tag.
Habe erst vor kurzem eure Hilfe in Anspruch genommen, aber da man ja mit der Zeit immer anspruchsvoller wird, hoffe ich Ihr könnt mir nochmals helfen.
Ich schreibe gerade an einem Simplen aufnahme Programm, das bei Start direkt mit der Aufnahme beginnt.
Nun habe ich ein problem dabei:
Ich starte alles über eine Filemaker Datenbank, das heist, per Knopfdruck wird mein kleines Progrämmchen gestartet und beginnt mit der Aufnahme.
Will ich jetzt jedoch eine neue aufnahme starten, müsste ich mein Programm beenden und Nochmals aufrufen.
Ist es irgendwie möglich einen befehl an mein Programm zu senden, das es veranlasst eine neue Aufnahme zu starten, ohne das ich es vorher beenden muss?
Ich hoffe Ihr könnt mir helfen.
Ich bedanke mich im vorraus für jeden, der wenigstens ein Auge auf mein Problem wirft.
ThaKilla
P.s. Falls es euch weiterhilft hänge ich mal meinen Code dran.
P.p.s. Ich weis Sauber ist er nicht gerade .
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal uReturnLength _
As Long, ByVal hwndCallback As Long) As Long
Private Declare Function PlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal _
uFlags As Long) As Long
Const path$ = "C:\Test.wav"
Dim RS$, CB&
Private Sub Form_Load()
If Dir$(path, vbNormal) <> "" Then Kill path
Dim bits As Long
Dim samples As Long
Dim c As Byte
Dim bytes As Long
RS = Space$(128)
bits = 16
samples = 44100
c = 2
bytes = (bits * samples * c) / 8
Me.Left = (Screen.Width - Me.Width) / 8
Me.Top = (Screen.Height - Me.Height) / 1
Call mciSendString("open new type waveaudio alias capture", _
RS, 128, CB)
mciSendString "SET CAPTURE TIME FORMAT MILLISECONDS BITSPERSAMPLE " & bits & _
" SAMPLESPERSEC " & samples & " CHANNELS " & c & " BYTESPERSEC " & bytes & _
" ALIGNMENT 4", RS, 128, CB
Call mciSendString("record capture", RS, 128, CB)
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
End Sub
Private Sub Command1_Click()
If Dir$(path, vbNormal) <> "" Then Kill path
Dim bits As Long
Dim samples As Long
Dim c As Byte
Dim bytes As Long
RS = Space$(128)
bits = 16
samples = 44100
c = 2
bytes = (bits * samples * c) / 8
Me.Left = (Screen.Width - Me.Width) / 8
Me.Top = (Screen.Height - Me.Height) / 1
Call mciSendString("open new type waveaudio alias capture", _
RS, 128, CB)
mciSendString "SET CAPTURE TIME FORMAT MILLISECONDS BITSPERSAMPLE " & bits & _
" SAMPLESPERSEC " & samples & " CHANNELS " & c & " BYTESPERSEC " & bytes & _
" ALIGNMENT 4", RS, 128, CB
Call mciSendString("record capture", RS, 128, CB)
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
End Sub
Private Sub Command2_Click()
If Command2.Caption = "Aufnahme Pause" Then
Call mciSendString("pause capture", RS, 128, CB)
Command2.Caption = "Aufnahme Weiter"
Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Else
Call mciSendString("record capture", RS, 128, CB)
Command2.Caption = "Aufnahme Pause"
Command1.Enabled = False
Command3.Enabled = True
Command4.Enabled = False
End If
End Sub
Private Sub Command3_Click()
RS = Space$(128)
Call mciSendString("stop capture", RS, 128, CB)
Call mciSendString("save capture " & path, RS, 128, CB)
Call mciSendString("close capture", RS, 128, CB)
Command1.Enabled = True
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = True
End Sub
Private Sub Command4_Click()
Dim Winamp As Long
Winamp = Shell("C:\Programme\Winamp\Winamp.exe c:\test.wav")
Command1.Enabled = True
Command2.Enabled = False
Command3.Enabled = False
End Sub |