home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / acmocx / acm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-08-24  |  4.4 KB  |  158 lines

  1. VERSION 5.00
  2. Object = "{E69FD844-2783-11D2-A800-0000B45D21D3}#1.0#0"; "ACM.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   7170
  6.    ClientLeft      =   165
  7.    ClientTop       =   450
  8.    ClientWidth     =   10950
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   7170
  11.    ScaleWidth      =   10950
  12.    StartUpPosition =   3  'Windows-Standard
  13.    Begin VB.CommandButton Command2 
  14.       Caption         =   "Command2"
  15.       Height          =   855
  16.       Left            =   600
  17.       TabIndex        =   10
  18.       Top             =   1440
  19.       Width           =   1935
  20.    End
  21.    Begin ACM_XLib.ACM_X ACM 
  22.       Height          =   495
  23.       Left            =   6000
  24.       TabIndex        =   9
  25.       Top             =   240
  26.       Width           =   495
  27.       _Version        =   65536
  28.       _ExtentX        =   873
  29.       _ExtentY        =   873
  30.       _StockProps     =   0
  31.    End
  32.    Begin VB.Frame Frame2 
  33.       Caption         =   "Compressed"
  34.       Height          =   735
  35.       Left            =   6720
  36.       TabIndex        =   7
  37.       Top             =   120
  38.       Width           =   2775
  39.       Begin VB.TextBox Text1 
  40.          Height          =   375
  41.          Left            =   120
  42.          TabIndex        =   8
  43.          Text            =   "c:\2.wav"
  44.          Top             =   240
  45.          Width           =   2535
  46.       End
  47.    End
  48.    Begin VB.Frame Frame1 
  49.       Caption         =   "Source"
  50.       Height          =   735
  51.       Left            =   120
  52.       TabIndex        =   5
  53.       Top             =   120
  54.       Width           =   3975
  55.       Begin VB.TextBox Text2 
  56.          Height          =   375
  57.          Left            =   120
  58.          TabIndex        =   6
  59.          Text            =   "d:\brennen\alt_d\look.wav"
  60.          Top             =   240
  61.          Width           =   3735
  62.       End
  63.    End
  64.    Begin VB.TextBox Text3 
  65.       Height          =   375
  66.       Left            =   9720
  67.       TabIndex        =   4
  68.       Top             =   360
  69.       Width           =   975
  70.    End
  71.    Begin VB.CommandButton Command1 
  72.       Caption         =   "Stop"
  73.       Height          =   495
  74.       Left            =   4680
  75.       TabIndex        =   3
  76.       Top             =   240
  77.       Width           =   1215
  78.    End
  79.    Begin VB.ListBox List3 
  80.       Height          =   5715
  81.       Left            =   6720
  82.       TabIndex        =   2
  83.       Top             =   1200
  84.       Width           =   3975
  85.    End
  86.    Begin VB.ListBox List2 
  87.       Height          =   5715
  88.       Left            =   4320
  89.       TabIndex        =   1
  90.       Top             =   1200
  91.       Width           =   2175
  92.    End
  93.    Begin VB.ListBox List1 
  94.       Height          =   3180
  95.       Left            =   120
  96.       TabIndex        =   0
  97.       Top             =   3720
  98.       Width           =   3975
  99.    End
  100. Attribute VB_Name = "Form1"
  101. Attribute VB_GlobalNameSpace = False
  102. Attribute VB_Creatable = False
  103. Attribute VB_PredeclaredId = True
  104. Attribute VB_Exposed = False
  105. Private Sub ACM_ConvertPosition(ByVal ConvertPosition As Long)
  106. Form1.Caption = ConvertPosition
  107. End Sub
  108. Private Sub Command1_Click()
  109. ACM.Stop
  110. End Sub
  111. Private Sub Command2_Click()
  112. Dim err
  113. ACM.SetInputFile ("c:\PCM.wav") ' 44khz/16Bit/stereo
  114. ACM.SetOutputFile ("c:\ADPCM.wav")
  115. 'find ADPCM codec
  116. For i = 1 To ACM.GetNumACMs
  117.     If ACM.GetNameACM(i) = "Microsoft IMA ADPCM CODEC" Then ACM.SelectACMDriver (i)
  118. Next i
  119. err = ACM.SetFormatTags(2) ' from Wave to ADPCM
  120. err = ACM.SetFormat(8) ' 44khz/4Bit/stereo
  121. err = ACM.Convert
  122. End Sub
  123. Private Sub Form_Load()
  124. Dim err
  125. End Sub
  126. Private Sub List1_DblClick()
  127. ACM.SetInputFile (Text2.Text)
  128. ACM.SetOutputFile (Text1.Text)
  129. ACM.SelectACMDriver (List1.ListIndex + 1)
  130. While List2.ListCount > 0
  131. List2.RemoveItem (0)
  132. DoEvents
  133. List2.Refresh
  134. For i = 1 To ACM.GetFormatTagsCount
  135.    List2.AddItem (ACM.GetFormatTags(i))
  136. Next i
  137. While List3.ListCount > 0
  138. List3.RemoveItem (0)
  139. DoEvents
  140. List3.Refresh
  141. End Sub
  142. Private Sub List2_DblClick()
  143. ACM.SetFormatTags (List2.ListIndex + 1)
  144. While List3.ListCount > 0
  145. List3.RemoveItem (0)
  146. DoEvents
  147. List3.Refresh
  148. For i = 1 To ACM.GetFormatsCount
  149.    List3.AddItem (ACM.GetFormat(i))
  150. Next i
  151. End Sub
  152. Private Sub List3_DblClick()
  153. Dim err
  154. err = ACM.SetFormat(List3.ListIndex + 1)
  155. Text3.Text = "Error: " & err
  156. err = ACM.Convert
  157. End Sub
  158.