www.pudn.com > 把MP3转换为WAV文件格式 .zip > Mp3ToWav.frm
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Object = "{3B00B10A-6EF0-11D1-A6AA-0020AFE4DE54}#1.0#0"; "MP3PLAY.OCX"
Begin VB.Form Mp3ToWav
BorderStyle = 3 'Fixed Dialog
Caption = "Qingyuan Mp3 To Wav V1.01"
ClientHeight = 3210
ClientLeft = 45
ClientTop = 330
ClientWidth = 6390
Icon = "Mp3ToWav.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3210
ScaleWidth = 6390
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Timer Timer1
Interval = 50
Left = 135
Top = 2385
End
Begin VB.CheckBox Check2
Height = 330
Left = 1665
Picture = "Mp3ToWav.frx":08CA
Style = 1 'Graphical
TabIndex = 35
ToolTipText = "注册控件、联系作者"
Top = 2520
UseMaskColor = -1 'True
Width = 510
End
Begin VB.Frame FK
Height = 1950
Left = 45
TabIndex = 28
Top = 2925
Visible = 0 'False
Width = 6315
Begin VB.CommandButton Command2
Caption = "确定(&O)"
Height = 330
Left = 4815
TabIndex = 29
ToolTipText = "保存"
Top = 1530
Width = 1050
End
Begin VB.Frame Frame4
Caption = "注册 Mp3Play.ocx 控件"
Height = 1095
Left = 360
TabIndex = 30
Top = 360
Width = 5505
Begin VB.TextBox Text3
Height = 270
Left = 900
TabIndex = 32
Top = 270
Width = 4515
End
Begin VB.TextBox Text4
Height = 270
Left = 900
TabIndex = 31
Top = 630
Width = 4515
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名:"
Height = 180
Index = 3
Left = 135
TabIndex = 34
Top = 315
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "注册号:"
Height = 180
Index = 2
Left = 135
TabIndex = 33
Top = 675
Width = 720
End
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Mail To Me:Qing-yuan@21cn.com"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 360
TabIndex = 36
Top = 1575
Width = 2430
End
End
Begin ComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 300
Left = 0
TabIndex = 27
Top = 2910
Width = 6390
_ExtentX = 11271
_ExtentY = 529
SimpleText = ""
_Version = 327682
BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
NumPanels = 3
BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Object.Width = 6703
MinWidth = 6703
Key = ""
Object.Tag = ""
EndProperty
BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
AutoSize = 2
Object.Width = 3175
MinWidth = 3175
Text = "This is Freeware!"
TextSave = "This is Freeware!"
Key = ""
Object.Tag = ""
EndProperty
BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Style = 5
Alignment = 1
Object.Width = 1764
MinWidth = 1764
TextSave = "9:34"
Key = ""
Object.Tag = ""
EndProperty
EndProperty
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 330
Index = 2
Left = 3735
Picture = "Mp3ToWav.frx":0E0C
Style = 1 'Graphical
TabIndex = 1
ToolTipText = "停止"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.CommandButton Command1
Height = 330
Index = 8
Left = 2745
Picture = "Mp3ToWav.frx":134E
Style = 1 'Graphical
TabIndex = 26
ToolTipText = "倒退100帧"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.CommandButton Command1
Height = 330
Index = 7
Left = 3240
Picture = "Mp3ToWav.frx":1890
Style = 1 'Graphical
TabIndex = 25
ToolTipText = "前进100帧"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin ComctlLib.ProgressBar Pbar
Height = 150
Left = 90
TabIndex = 23
Top = 2115
Width = 6180
_ExtentX = 10901
_ExtentY = 265
_Version = 327682
Appearance = 0
End
Begin VB.CommandButton Command1
Height = 330
Index = 5
Left = 5220
Picture = "Mp3ToWav.frx":1DD2
Style = 1 'Graphical
TabIndex = 21
ToolTipText = "打开"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 330
Index = 4
Left = 4725
Picture = "Mp3ToWav.frx":2314
Style = 1 'Graphical
TabIndex = 19
ToolTipText = "转换到WAV文件"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.CommandButton Command1
Height = 330
Index = 3
Left = 5805
Picture = "Mp3ToWav.frx":2856
Style = 1 'Graphical
TabIndex = 3
ToolTipText = "退出"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 330
Index = 1
Left = 4230
Picture = "Mp3ToWav.frx":2D98
Style = 1 'Graphical
TabIndex = 2
ToolTipText = "暂停"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin VB.Frame Frame1
Height = 1545
Left = 90
TabIndex = 5
Top = -45
Width = 6225
Begin VB.Frame Frame2
Caption = "转换信息"
Height = 1275
Left = 3690
TabIndex = 12
Top = 135
Width = 2445
Begin VB.CommandButton Command1
Caption = "试听"
Enabled = 0 'False
Height = 285
Index = 6
Left = 1665
TabIndex = 24
ToolTipText = "试听"
Top = 900
Width = 645
End
Begin VB.TextBox Text2
Height = 285
Left = 720
TabIndex = 17
Text = "0"
Top = 540
Width = 1590
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 16
Text = "0"
Top = 225
Width = 1590
End
Begin VB.Label Zhongchang
AutoSize = -1 'True
Height = 180
Left = 90
TabIndex = 18
Top = 945
Width = 90
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "结束帧"
Height = 180
Index = 1
Left = 90
TabIndex = 15
Top = 585
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "起始帧"
Height = 180
Index = 0
Left = 90
TabIndex = 14
Top = 270
Width = 540
End
End
Begin VB.Label BitS
AutoSize = -1 'True
Caption = "BitRate:未知"
Height = 180
Left = 135
TabIndex = 10
Top = 1125
Width = 1170
End
Begin VB.Label Caiyin
AutoSize = -1 'True
Caption = "采音频率:未知"
Height = 180
Left = 135
TabIndex = 9
Top = 900
Width = 1260
End
Begin VB.Label Zheng
AutoSize = -1 'True
Caption = "长度:未知"
Height = 180
Left = 135
TabIndex = 8
Top = 675
Width = 900
End
Begin VB.Label ShDao
AutoSize = -1 'True
Caption = "立体声:"
Height = 180
Left = 135
TabIndex = 7
Top = 450
Width = 720
End
Begin VB.Label MName
AutoSize = -1 'True
Caption = "曲目:未知"
Height = 180
Left = 135
TabIndex = 6
Top = 225
Width = 900
End
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 330
Index = 0
Left = 2250
Picture = "Mp3ToWav.frx":32DA
Style = 1 'Graphical
TabIndex = 4
ToolTipText = "播放键"
Top = 2520
UseMaskColor = -1 'True
Width = 500
End
Begin MPEGPLAYLib.Mp3Play MP
Height = 375
Left = 90
TabIndex = 0
Top = 2430
Visible = 0 'False
Width = 510
_Version = 65536
_ExtentX = 900
_ExtentY = 661
_StockProps = 0
End
Begin ComctlLib.Slider Sder
Height = 240
Left = 0
TabIndex = 13
TabStop = 0 'False
ToolTipText = "拖放滑动块可快进或回退"
Top = 1845
Width = 6360
_ExtentX = 11218
_ExtentY = 423
_Version = 327682
Max = 500
SelectRange = -1 'True
TickStyle = 3
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Copyright(C) Qingyuan Studio 1998-1999"
BeginProperty Font
Name = "Arial"
Size = 7.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 180
Left = 3330
TabIndex = 22
ToolTipText = "Copyright(C) Qingyuan Studio 1998-1999"
Top = 2295
Width = 2940
End
Begin VB.Image Image1
Height = 510
Left = 90
ToolTipText = "调节音量"
Top = 2340
Width = 510
End
Begin VB.Label PlaySong
Height = 285
Left = 2295
TabIndex = 20
Top = 1620
Visible = 0 'False
Width = 2895
End
Begin VB.Label DangQian
AutoSize = -1 'True
Caption = "当前帧:"
Height = 180
Left = 225
TabIndex = 11
Top = 1620
Width = 720
End
End
Attribute VB_Name = "Mp3ToWav"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Pok As Long
Dim Pn As String
Dim PKey As String
Dim Sheng As String
Dim ToWavSong As String
Dim PS As Long
Dim Comline As String
Private Sub Check2_Click()
If Check2.Value = 1 Then
Me.Height = 5565
FK.Visible = True
Else
Me.Height = 3585
FK.Visible = False
End If
End Sub
Private Sub Check2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = Check2.ToolTipText
End Sub
Private Sub Command1_Click(Index As Integer)
On Error Resume Next
Select Case Index
Case 0
Command1(1).Enabled = True
Command1(2).Enabled = True
Command1(4).Enabled = False
Command1(6).Enabled = False
Sder.Enabled = True
MP.Close
PS = MP.Open(PlaySong, "")
MPinfo
MP.Play
Case 1
MP.Pause
If Command1(0).Enabled = True Then
Command1(0).Enabled = False
ElseIf Command1(0).Enabled = False Then
Command1(0).Enabled = True
End If
Case 2
MP.Close
Sder.Value = 0
Command1(1).Enabled = False
Sder.Enabled = False
Command1(0).Enabled = True
Command1(4).Enabled = True
Command1(6).Enabled = True
Case 3
Pn = ""
Sheng = ""
ToWavSong = ""
End
Case 4
ToWavSong = InputBox("请输入目标文件路径(无须输入扩展名WAV):", "请输入", Left$(PlaySong, Len(PlaySong) - 4))
If ToWavSong = "" Then GoTo Box
PS = MP.Open(PlaySong, ToWavSong & ".wav")
Sder.Value = Text1.Text
MP.Play
MP.Seek (Text1.Text)
Timer1.Enabled = True
Case 5
OpenMpx.Show
Case 6
PS = MP.Open(PlaySong, "")
Sder.Value = Text1.Text
MP.Play
MP.Seek (Text1.Text)
Timer1.Enabled = True
Case 7
Sder.Value = Sder.Value + 100
PS = MP.Seek(Sder.Value)
Case 8
Sder.Value = Sder.Value - 100
PS = MP.Seek(Sder.Value)
End Select
Box:
End Sub
Private Sub Command1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Index = 4 Then
Command1(4).ToolTipText = "转换。可能存在少许的时间误差。"
End If
StatusBar1.Panels(1).Text = Command1(Index).ToolTipText
End Sub
Sub ReadINI()
R = GetPrivateProfileString(INIDuan, INIKey, INIDefault, INIGet, I, INIFile)
End Sub
Sub WriteINI()
R = WritePrivateProfileString(INIDuan, INIKey, INIStr, INIFile)
End Sub
Private Sub Command2_Click()
INIDuan = "Reginfo"
INIKey = "User"
INIStr = Text3.Text
WriteINI
INIKey = "RegCode"
INIStr = Text4.Text
WriteINI
End Sub
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = Command2.ToolTipText
End Sub
Private Sub FK_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label3.ForeColor = &H0&
Label3.FontBold = False
End Sub
Private Sub Form_Load()
On Error Resume Next
'Comline = GetCommandLine
If Len(App.Path) = 3 Then
Mypath = App.Path
Else
Mypath = App.Path & "\"
End If
INIFile = Mypath & "Mtw.ini"
INIDuan = "Reginfo"
INIDefault = " "
INIGet = String(255, Chr(10))
I = Len(INIGet) + 1
INIKey = "User"
ReadINI
Me.Caption = INIGet
Pn = Me.Caption
Text3.Text = Pn
INIKey = "RegCode"
ReadINI
Me.Caption = INIGet
PKey = Me.Caption
Text4.Text = PKey
'If Len(Comline) <> 0 Then
' Comline = Trim(Right(Comline, Len(Comline) - Len(Mypath & "Mp3ToWav.exe") - 2))
' MsgBox Comline
'End If
Me.Caption = "Qingyuan Mp3 To Wav V1.01"
Image1.Picture = Me.Icon
Pok = MP.Authorize(Pn, PKey)
If Pok <> 0 Then
Check2.Value = 1
MsgBox "Mp3play.ocx 控件没有注册,请输入正确的注册码,否则程序只能转换MP3文件的前35秒。", 64
End If
End Sub
Sub MPinfo()
MP.FrameNotifyCount = 10
Sder.Max = MP.FrameCount
Pbar.Max = Sder.Max
If MP.MPEGMode = 4 Then
Sheng = "立体声:否"
ElseIf MP.MPEGMode = 2 Then
Sheng = "立体声:是"
End If
MName.Caption = "曲目:" & UCase(Dir(PlaySong))
ShDao.Caption = Sheng
Zheng.Caption = "长度:" & MP.FrameCount & "帧,计 " & Format(MP.FrameCount * MP.MsPerFrame \ 1000 \ 60, "#0分") & Format((MP.FrameCount * MP.MsPerFrame) \ 1000 Mod 60, "00 秒")
Caiyin.Caption = "采音频率:" & MP.SampleFrequency \ 1000 & " khz"
BitS.Caption = "BitRate:" & MP.BitRate \ 1000 & " kbps"
Text2.Text = MP.FrameCount
ZHinfo
End Sub
Sub ZHinfo()
On Error Resume Next
Zhongchang.Caption = "长度为:" & Format((Text2.Text - Text1.Text) * MP.MsPerFrame / 1000, "#0.00 秒")
Sder.SelStart = Text1.Text
Sder.SelLength = Text2.Text - Text1.Text
End Sub
Private Sub Image1_Click()
Shell "SNDVOL32.EXE", 1
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = Image1.ToolTipText
End Sub
Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = "Copyright(C) Qingyuan Studio 1998-1999"
End Sub
Private Sub Label3_Click()
R = ShellExecute(0&, vbNullString, "mailto:Qing-yuan@21cn.com", vbNullString, vbNullString, vbNormalFocus)
End Sub
Private Sub Label3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label3.ForeColor = &HFF&
Label3.FontBold = True
StatusBar1.Panels(1).Text = "给我发信"
End Sub
Private Sub MP_ActFrame(ByVal ActFrame As Long)
Sder.Value = ActFrame
Pbar.Value = Sder.Value
End Sub
Private Sub Sder_Change()
On Error Resume Next
DangQian.Caption = "当前帧:" & Sder.Value & ",第" & Format(Sder.Value * MP.MsPerFrame / 1000, "#0.00 秒")
Pbar.Value = Sder.Value
End Sub
Private Sub Sder_Click()
PS = MP.Seek(Sder.Value)
End Sub
Private Sub Sder_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1(1).Value = True
End Sub
Private Sub Sder_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1(1).Value = True
End Sub
Private Sub Sder_Scroll()
On Error Resume Next
DangQian.Caption = "当前帧:" & Sder.Value & ",第" & Format(Sder.Value * MP.MsPerFrame / 1000, "#0.00 秒")
Pbar.Value = Sder.Value
End Sub
Private Sub Text1_Change()
ZHinfo
End Sub
Private Sub Text2_Change()
ZHinfo
End Sub
Private Sub Text3_Change()
Pn = Text3.Text
PKey = Text4.Text
Pok = MP.Authorize(Pn, PKey)
If Pok <> 0 Then
Frame4.Caption = "注册 Mp3Play.ocx 控件(注册不正确)"
Else
Frame4.Caption = "注册 Mp3Play.ocx 控件(注册正确)"
End If
End Sub
Private Sub Text4_Change()
Pn = Text3.Text
PKey = Text4.Text
Pok = MP.Authorize(Pn, PKey)
If Pok <> 0 Then
Frame4.Caption = "注册 Mp3Play.ocx 控件(注册不正确)"
Else
Frame4.Caption = "注册 Mp3Play.ocx 控件(注册正确)"
End If
End Sub
Private Sub Timer1_Timer()
If Sder.Value > Text2.Text - 30 Or Sder = Text2.Text Then
MP.Close
Timer1.Enabled = False
End If
End Sub