WAV文件基本信息包括如是否立体声,采样频率等。
声明:
PublicConstRIFF_ID=1179011410
PublicConstRIFF_WAVE=1163280727
PublicConstRIFF_FMT=544501094
TypicalheaderofasimpleRIFFWAVEfile
PublicTypeWAVInfo
Riff_FormatAsLong
chunk_sizeAsLong
ChunkIDAsLongfmtAsLong
Wave_FormatAsInteger
ChannelsAsInteger0=单声道,1=立体声
SamplesPerSecondAsLong
AverageBytesPerSecondAsLong11.025kHz,22.05kHz,等
BlockAlignAsIntegerSizeofblocksforlowlevelplayback
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->