Page 1 of 1

How to play a sample exactly once with TLiveAudioPlayer

PostPosted: July 9th, 2014, 7:56 pm
by toto
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?

Re: How to play a sample exactly once with TLiveAudioPlayer

PostPosted: September 21st, 2014, 9:29 am
by Kambiz
Set NumLoops to 1 instead 0. The component considers zero as forever.