How to play a sample exactly once with TLiveAudioPlayer

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

How to play a sample exactly once with TLiveAudioPlayer

Postby toto » July 9th, 2014, 7:56 pm

I am trying to play an audio sample stored in memory exactly once, but when actiavted TLiveAudioPLayer loops the sample endlessly.
BufferInternally is set to False:
Code: Select all
function TfrmMain.lapDataPtr(Sender: TObject; var Buffer: Pointer;
  var NumLoops: Cardinal; var FreeIt: Boolean): Cardinal;
begin
 Buffer := @Sample16[0]; // Sample16: Array of SmallInt;
 NumLoops := 0;
 FreeIt := False;
 Result := Length(Sample16);
end;

Is it possible to play the sample exactly once?
toto
Member
Member
 
Posts: 1
Joined: July 9th, 2014, 7:50 pm

Re: How to play a sample exactly once with TLiveAudioPlayer

Postby Kambiz » September 21st, 2014, 9:29 am

Set NumLoops to 1 instead 0. The component considers zero as forever.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron