在Windows下直接用
AcsAudioOut1:=TAcsAudioOut.Create(Nil);
AcsAudioOut1.Delay:=6;
AcsAudioOut1.DriverName:='Wavemapper';
AcsAudioOut1.Volume:=80;
AcsFileIn1:=TAcsFileIn.Create(Nil);
AcsAudioOut1.Input:=AcsFileIn1;
AcsFileIn1.FileName:=ExtractFilePath(Application.ExeName) +'temp/A5.wav';
AcsAudioOut1.Run();
就可以播放
但在Linux下就不行。
1、改C:\LazarusFPC\config_lazarus\onlinepackagemanager\packages\acs\src\filters\acs_procs.pas
{$IFDEF LINUX}
function FindLibs(const Pattern: String): String;
function FindInPath(sPath: string): string;
var
SR: TSearchRec;
begin
Result:='';
if FindFirst(sPath+Pattern, faAnyFile, SR) = 0 then
begin
Result := sPath+SR.Name;
FindClose(SR);
end;
end;
begin
//----改下面的
{$IfDef CPUI386}
Result:=FindInPath('/usr/lib/');
{$Else}
Result:=FindInPath('/usr/lib64/');
{$EndIf}
//---完成
if Result = '' then Result:=FindInPath('/usr/lib/i386-linux-gnu/');
if Result = '' then Result:=FindInPath('/usr/lib/x86_64-linux-gnu/');
if Result = '' then Result:=FindInPath('/usr/local/lib/');
end;
{$ENDIF}
2、改驱动
AcsAudioOut1.DriverName:='Alsa';//或是AOLive,看你的系统安装的是那个驱动
浙公网安备 33010602011771号