home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / addres / recordit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  3.5 KB  |  116 lines

  1. VERSION 2.00
  2. Begin Form RecordIt 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Voice Recorder"
  5.    ClientHeight    =   1110
  6.    ClientLeft      =   2835
  7.    ClientTop       =   3150
  8.    ClientWidth     =   3015
  9.    Height          =   1515
  10.    Left            =   2775
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1110
  15.    ScaleWidth      =   3015
  16.    Top             =   2805
  17.    Width           =   3135
  18.    Begin CommandButton Command1 
  19.       Caption         =   "&Start"
  20.       FontBold        =   -1  'True
  21.       FontItalic      =   0   'False
  22.       FontName        =   "Arial"
  23.       FontSize        =   9.75
  24.       FontStrikethru  =   0   'False
  25.       FontUnderline   =   0   'False
  26.       Height          =   375
  27.       Left            =   720
  28.       TabIndex        =   1
  29.       Top             =   480
  30.       Width           =   1575
  31.    End
  32.    Begin Label Label1 
  33.       AutoSize        =   -1  'True
  34.       Caption         =   "Ready ....."
  35.       FontBold        =   -1  'True
  36.       FontItalic      =   0   'False
  37.       FontName        =   "Arial"
  38.       FontSize        =   12
  39.       FontStrikethru  =   0   'False
  40.       FontUnderline   =   0   'False
  41.       ForeColor       =   &H000000FF&
  42.       Height          =   285
  43.       Left            =   240
  44.       TabIndex        =   0
  45.       Top             =   120
  46.       Width           =   1095
  47.    End
  48. Sub Command1_Click ()
  49. If Command1.Caption = "&Start" Then
  50.     If Not MMSend%("Record talk") Then
  51.         y% = MMSend%("close talk")
  52.         RecordIt.Tag = "NO"
  53.         RecordIt.Hide
  54.         Exit Sub
  55.     Else
  56.         Label1.Caption = "Recording ......"
  57.         Label1.Refresh
  58.         Command1.Caption = "&Stop"
  59.         Command1.Refresh
  60.     End If
  61.     If Not MMSend%("stop talk") Then
  62.         y% = MMSend%("close talk")
  63.         RecordIt.Tag = "NO"
  64.         RecordIt.Hide
  65.         Exit Sub
  66.     Else
  67.         Command1.Enabled = False
  68.         Label1.Caption = "Stopped .... Saving"
  69.         Label1.Refresh
  70.         If Address.Label14.Caption <> "" Then
  71.             xx$ = Address.Label14.Caption
  72.             Address.Label14.Caption = ""
  73.             On Error Resume Next
  74.             Kill xx$
  75.         End If
  76.         Randomize
  77.         'pick a unique file name
  78.         Do
  79.             TheNum& = Int(65000 * Rnd)
  80.             TheString$ = CStr(TheNum&)
  81.             TheString$ = "V" & TheString$
  82.             TheFile$ = ThePath & TheString$ & ".wav"
  83.             If Dir$(TheFile$) = "" Then Exit Do
  84.         Loop
  85.         SaveCmd$ = "save talk " & TheFile$
  86.         If Not MMSend%(SaveCmd$) Then
  87.             y% = MMSend%("close talk")
  88.             RecordIt.Tag = "NO"
  89.             RecordIt.Hide
  90.             Exit Sub
  91.         Else
  92.             y% = MMSend%("close talk")
  93.             RecordIt.Tag = "YES"
  94.             Address.Label14.Caption = TheFile$  'make sure to update label14
  95.             RecordIt.Hide
  96.         End If
  97.     End If
  98. End If
  99. End Sub
  100. Sub Form_Load ()
  101. 'if can't open then hide form
  102. If Not MMSend%("open new type waveaudio alias talk") Then
  103.     RecordIt.Tag = "NO"
  104.     RecordIt.Hide
  105.     Exit Sub
  106. End If
  107. RecordIt.Top = Address.Top + ((Address.Height - RecordIt.Height) \ 3)
  108. RecordIt.Left = Address.Left + ((Address.Width - RecordIt.Width) \ 2)
  109. End Sub
  110. Sub Form_Unload (Cancel As Integer)
  111. 'must make sure we are closed here. if not mmsystem will
  112. 'reload the form and start running it again. must be a
  113. 'call back set up ???
  114. y% = MMSend%("close talk")
  115. End Sub
  116.