📄 wavesee.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form WaveSee
Caption = "Form1"
ClientHeight = 6315
ClientLeft = 60
ClientTop = 345
ClientWidth = 10620
LinkTopic = "Form1"
ScaleHeight = 6315
ScaleWidth = 10620
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog dlgGetFile
Left = 2040
Top = 5520
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 5295
Left = 0
ScaleHeight = 5265
ScaleWidth = 10545
TabIndex = 1
Top = 120
Width = 10575
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 0
TabIndex = 0
Top = 5520
Width = 1695
End
End
Attribute VB_Name = "WaveSee"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sFileName As String
Dim hRIFF As RIFFHead
Dim hWAVE As WAVEHead
Dim hWAVEEx As WAVEHeadEx
Dim fn
Dim WData() As Byte
dlgGetFile.Filter = "*.wav"
dlgGetFile.ShowOpen
sFileName = dlgGetFile.FileName
If sFileName = "" Then Exit Sub
fn = FreeFile()
Open sFileName For Binary Access Read Shared As #fn
Get #fn, , hRIFF
If hRIFF.WaveHeadSize = 16 Then
Get #fn, , hWAVE
ReDim WData(0 To hWAVE.DataSize - 1)
k = hWAVE.DataSize - 1
Else
Get #fn, , hWAVEEx
ReDim WData(0 To hWAVEEx.DataSize - 1)
k = hWAVEEx.DataSize - 1
End If
Get #fn, , WData
Close #fn
Picture1.Scale (0, 256)-(k, 0)
Picture1.Cls
For i = 0 To k
Picture1.Line -(i, WData(i))
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -