unitConvertToWav;
interface
uses
SysUtils,Variants,Classes,Types,FileOperator,DataTypeDef,StrUtils,MMSystem,DMUnit,ADODB,ActiveX,ComObj,
Windows,Forms;
type
TSoundInfo=class
classfunctionGetSoundLength(fileName:string):Integer;
end;
implementation
classfunctionTSoundInfo.GetSoundLength(fileName:string):Integer;
var
lengthBuf:Array[0..31]ofChar;
begin
MCISendString(PChar('open"'+fileName+'"typewaveaudioaliaswave'),nil,0,0);
MCISendString('statuswavelength',lengthBuf,Length(lengthBuf),0);
MCISendString('closewave',nil,0,0);
try
Result:=StrToInt(lengthBuf)div1000;
except
Application.MessageBox('获取通话时长出错','',0);
end;
end;
如上代码调用在WindowsXP和Windows7下都正常,在WindowsServer2003下出错,请问是什么原因?谢谢大家!
分 -->
|