取得WAV文件信息
WAV文件基本信息包括如是否立体声,采样频率等。 声明: PublicConstRIFF_ID=1179011410 PublicConstRIFF_WAVE=1163280727 PublicConstRIFF_FMT=544501094 TypicalheaderofasimpleRIFFWAVEfile PublicTypeWAVInfo Riff_FormatAsLong c
WAV文件基本信息包括如是否立体声,采样频率等。
声明:
PublicConstRIFF_ID=1179011410
PublicConstRIFF_WAVE=1163280727
PublicConstRIFF_FMT=544501094
'TypicalheaderofasimpleRIFFWAVEfile
PublicTypeWAVInfo
Riff_FormatAsLong
chunk_sizeAsLong
ChunkIDAsLongfmtAsLong
Wave_FormatAsInteger
ChannelsAsInteger'0=单声道,1=立体声
SamplesPerSecondAsLong
AverageBytesPerSecondAsLong'11.025kHz,22.05kHz,等
BlockAlignAsInteger'Sizeofblocksforlowlevelplayback
EndType
函数:
PublicFunctionGetWaveInfo(ByvalfilenameAsString,ByrefwAsWAVInfo)_
AsBoolean
DimffAsInteger
ff=FreeFile
OnErrorGoToehandler
OpenfilenameForBinaryAccessReadAs#ff
OnErrorGoToehandler_fo
Get#ff,,w
Close#ff
OnErrorGoToehandler
Ifw.Riff_Format=RIFF_IDAndw.ChunkID=_
RIFF_WAVEAndw.fmt=RIFF_FMTThen
GetWaveInfo=True
Else
GetWaveInfo=False
EndIf
ExitFunction
ehandler_fo:
Close#ff
ehandler:
GetWaveInfo=False
EndFunction->
声明:
PublicConstRIFF_ID=1179011410
PublicConstRIFF_WAVE=1163280727
PublicConstRIFF_FMT=544501094
'TypicalheaderofasimpleRIFFWAVEfile
PublicTypeWAVInfo
Riff_FormatAsLong
chunk_sizeAsLong
ChunkIDAsLongfmtAsLong
Wave_FormatAsInteger
ChannelsAsInteger'0=单声道,1=立体声
SamplesPerSecondAsLong
AverageBytesPerSecondAsLong'11.025kHz,22.05kHz,等
BlockAlignAsInteger'Sizeofblocksforlowlevelplayback
EndType
函数:
PublicFunctionGetWaveInfo(ByvalfilenameAsString,ByrefwAsWAVInfo)_
AsBoolean
DimffAsInteger
ff=FreeFile
OnErrorGoToehandler
OpenfilenameForBinaryAccessReadAs#ff
OnErrorGoToehandler_fo
Get#ff,,w
Close#ff
OnErrorGoToehandler
Ifw.Riff_Format=RIFF_IDAndw.ChunkID=_
RIFF_WAVEAndw.fmt=RIFF_FMTThen
GetWaveInfo=True
Else
GetWaveInfo=False
EndIf
ExitFunction
ehandler_fo:
Close#ff
ehandler:
GetWaveInfo=False
EndFunction->
精彩图集
精彩文章