各位好,哪位有详细的wav文件格式,请帮忙提供一下。
我读取了wav文件的前8字节,分别为 “RIFF”与一个整型数,按照一些资料上说,
整型数为文件长度-8,可是我得到的确是文件长度-58,不知为何,请高手指点,谢谢!
我读取了wav文件的前8字节,分别为 “RIFF”与一个整型数,按照一些资料上说,
整型数为文件长度-8,可是我得到的确是文件长度-58,不知为何,请高手指点,谢谢!
解决方案 »
- 请问为什么textbox的locked为false的时候还能接收粘贴呢?
- 我想出售我的软件源码,给个价吧!
- vb+ado下编辑记录时老是报错,我怀疑是recordset 打开的方式不对,请高手提供明示或提供相应的demo,谢谢!◎
- 高分求教:把double型数转化为16进制怎么转?
- vb savegrid性性导出vsflexgrid中大量内容
- 请问为什么我一用vsflex7.0,运行时就会弹出个小窗口呢?怎么解决?
- 请问如何得到本机名及IP?
- 谁有自己写的控件的源程序,100分
- problem,请教
- vb系统含有Crystal reports做的报表,做安装盘时除了.rpt外,还应把哪些文件包含进来
- 关于windows shell extension 编程的问题!
- internet transfer控件中INET 运行时怎么老出现以下情况
Dim yint As Integer, ybt As Byte
Dim LenData As Long, InData As Long
Dim Nbits As Integer, StMo As String
Me.Caption = "Waveform View - " & "(" & FName & ")"
Label1.Caption = "File: " & FName Open FName For Binary Access Read As #1
Label2.Caption = "Size: " & LOF(1) & " Bytes"
Label3.Left = Label1.Left + Label1.Width + 500
Label3.Caption = "Last modified: " & FileDateTime(FName)
Label4.Caption = 0 'IniPlay of present Zoom
Label17.Caption = 0 '= selected Samples
For n = 1 To 100
X$ = Input(4, #1)
If n = 2 Then HOLDER$ = X$ ' Hold This for Saving a New Wav
If X$ = "fmt " Then Exit For 'Ignore everything else till this
Next n
'Get the Wave File Header Info
Get #1, , yLec ' 16
Get #1, , yint 'Compression Type (1=PCM)
Get #1, , yint 'is Channels, 1 if mono and 2 if stereo If yint = 2 Then
Label9.Caption = "Stereo"
ElseIf yint = 1 Then
Label9.Caption = "Mono"
Else
Label9.Caption = "Error!"
GoTo Errhandler
End If
Get #1, , yLec 'is the Sampling frequency of the file Label8.Caption = yLec
Get #1, , yLec 'is a multiple of the sample frequency Get #1, , yint 'is the divisor of the number of bytes of
'data which gives the number of Samples in the .wav
yDiv = yint
Label12.Caption = yDiv
Get #1, , yint 'is the number of bits (8 or 16) If yint = 8 Or yint = 16 Then
Label10.Caption = yint & " bits"
Else
Label10.Caption = "Error"
GoTo Errhandler
End If
GotTheData:
For n = 1 To 100
Y$ = Input(1, #1) If Y$ = "d" Then Exit For ' Seek for start of Wav Data Next n
Z$ = Input(3, #1)
If Z$ <> "ata" Then 'Wav Data Starts here
If n > 90 Then GoTo Errhandler
Temp = Seek(1)
Seek #1, Temp - 3
GoTo GotTheData
End If
Get #1, , yLec '= num of bytes of data, start reading data here. Label13.Caption = yLec
LenData = yLec / yDiv
Label6(0).Caption = LenData
Label6(1).Caption = LenData
LenTemp = LenData / (Label8.Caption)
Extemp = (Int(LenTemp * 1000)) / 1000
If LenTemp - Extemp >= 0.0005 Then
Extemp = Extemp + 0.001
End If
Label14.Caption = "Length: " & Extemp & " seconds"
Label15(0).Caption = LenTemp
Label15(1).Caption = LenTemp
FimPlay = Int(LenTemp * 1000)
InData = Seek(1) 'Loc(1) + 1 is the number of the first sound data byte of the file.
Label11.Caption = InData
StMo = Label9.Caption
Nbits = Val(Label10.Caption)
MousePointer = vbHourglass 'Busy
Call GraphWave(InData, LenData, Nbits, StMo)
Close #1
Call DrawTickMarks
MousePointer = 0 ' Arrow
PlayControls = True
If Label9.Caption = "Stereo" Then
Frame2.Visible = True
Frame1.Height = 1815
Else
Frame2.Visible = False
Frame1.Height = 800
End If
MousePointer = 0
Exit Sub
Errhandler:
MsgBox "Error!!", vbOKOnly
Close #1