How to play a sample exactly once with TLiveAudioPlayer

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

How to play a sample exactly once with TLiveAudioPlayer

Postby toto » 09/07/14 19:56

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: 09/07/14 19:50

Re: How to play a sample exactly once with TLiveAudioPlayer

Postby Kambiz » 21/09/14 09:29

Set NumLoops to 1 instead 0. The component considers zero as forever.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2382
Joined: 07/03/03 19:10
Location: The Netherlands


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 3 guests