How to play a sample exactly once with TLiveAudioPlayer
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:
Is it possible to play the sample exactly once?
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?