Skip to content

Commit

Permalink
xrSound: preload sound content right at the sound start
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Mar 20, 2024
1 parent a50696b commit 3fc4188
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/xrSound/SoundRender_Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ void CSoundRender_Target::start(CSoundRender_Emitter* E)
// Calc storage
for (auto& buf : temp_buf)
buf.resize(E->source()->m_info.bytesPerBuffer);

dispatch_prefill_all();
}

void CSoundRender_Target::render()
{
VERIFY(!rendering);
rendering = true;
wait_prefill();
}

void CSoundRender_Target::stop()
Expand Down
5 changes: 2 additions & 3 deletions src/xrSound/SoundRender_TargetA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ void CSoundRender_TargetA::_restart()

void CSoundRender_TargetA::render()
{
fill_all_blocks();
inherited::render();

submit_all_buffers();

A_CHK(alSourceQueueBuffers(pSource, sdef_target_count, pBuffers));
A_CHK(alSourcePlay(pSource));

inherited::render();

dispatch_prefill_all();
}

Expand Down

0 comments on commit 3fc4188

Please sign in to comment.