Skip to content

Commit

Permalink
Bump up audio buffer size, don't preview instrument if playing
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Dec 11, 2023
1 parent ad82f8d commit 75308d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sound.pas
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ procedure EnableSound;
Want.freq := playbackFrequency;
Want.format := AUDIO_F32;
Want.channels := 2;
Want.samples := 512;
Want.samples := 1024;
Want.callback := @AudioCallback;

PlayStream := SDL_OpenAudioDevice(nil, 0, @Want, @Have, 0);
Expand Down
4 changes: 3 additions & 1 deletion src/tracker.pas
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ procedure TfrmTracker.PreviewInstrument(Note: Integer; Instr: TInstrument;
Addr: Integer;
Wave: TWave;
begin
if Playing then Exit;

LockPlayback;

if Instr.Type_ = itWave then begin
Expand All @@ -888,7 +890,7 @@ procedure TfrmTracker.PreviewInstrument(Note: Integer; Instr: TInstrument;

procedure TfrmTracker.PreviewNote(Note: Integer);
begin
if not LoadingFile then begin
if (not Playing) and (not LoadingFile) then begin
PreviewInstrument(Note, UnmodInst(CurrentInstrumentBank, InstrumentNumberSpinner.Value));
NoteHaltTimer.Enabled := False;
NoteHaltTimer.Enabled := True
Expand Down

0 comments on commit 75308d0

Please sign in to comment.