home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form RecordIt
- BorderStyle = 3 'Fixed Double
- Caption = "Voice Recorder"
- ClientHeight = 1110
- ClientLeft = 2835
- ClientTop = 3150
- ClientWidth = 3015
- Height = 1515
- Left = 2775
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1110
- ScaleWidth = 3015
- Top = 2805
- Width = 3135
- Begin CommandButton Command1
- Caption = "&Start"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 720
- TabIndex = 1
- Top = 480
- Width = 1575
- End
- Begin Label Label1
- AutoSize = -1 'True
- Caption = "Ready ....."
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 285
- Left = 240
- TabIndex = 0
- Top = 120
- Width = 1095
- End
- Sub Command1_Click ()
- If Command1.Caption = "&Start" Then
- If Not MMSend%("Record talk") Then
- y% = MMSend%("close talk")
- RecordIt.Tag = "NO"
- RecordIt.Hide
- Exit Sub
- Else
- Label1.Caption = "Recording ......"
- Label1.Refresh
- Command1.Caption = "&Stop"
- Command1.Refresh
- End If
- If Not MMSend%("stop talk") Then
- y% = MMSend%("close talk")
- RecordIt.Tag = "NO"
- RecordIt.Hide
- Exit Sub
- Else
- Command1.Enabled = False
- Label1.Caption = "Stopped .... Saving"
- Label1.Refresh
- If Address.Label14.Caption <> "" Then
- xx$ = Address.Label14.Caption
- Address.Label14.Caption = ""
- On Error Resume Next
- Kill xx$
- End If
- Randomize
- 'pick a unique file name
- Do
- TheNum& = Int(65000 * Rnd)
- TheString$ = CStr(TheNum&)
- TheString$ = "V" & TheString$
- TheFile$ = ThePath & TheString$ & ".wav"
- If Dir$(TheFile$) = "" Then Exit Do
- Loop
- SaveCmd$ = "save talk " & TheFile$
- If Not MMSend%(SaveCmd$) Then
- y% = MMSend%("close talk")
- RecordIt.Tag = "NO"
- RecordIt.Hide
- Exit Sub
- Else
- y% = MMSend%("close talk")
- RecordIt.Tag = "YES"
- Address.Label14.Caption = TheFile$ 'make sure to update label14
- RecordIt.Hide
- End If
- End If
- End If
- End Sub
- Sub Form_Load ()
- 'if can't open then hide form
- If Not MMSend%("open new type waveaudio alias talk") Then
- RecordIt.Tag = "NO"
- RecordIt.Hide
- Exit Sub
- End If
- RecordIt.Top = Address.Top + ((Address.Height - RecordIt.Height) \ 3)
- RecordIt.Left = Address.Left + ((Address.Width - RecordIt.Width) \ 2)
- End Sub
- Sub Form_Unload (Cancel As Integer)
- 'must make sure we are closed here. if not mmsystem will
- 'reload the form and start running it again. must be a
- 'call back set up ???
- y% = MMSend%("close talk")
- End Sub
-