Skip to content

Commit

Permalink
fix(mumble): voice crackling on low-end PCs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prikolium-cfx committed Oct 3, 2024
1 parent c406168 commit 0bf3d3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion code/components/voip-mumble/src/MumbleAudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ void MumbleAudioInput::ThreadFunc()
{
SetThreadName(-1, "[Mumble] Audio Input Thread");

SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
HANDLE mmcssHandle;
DWORD mmcssTaskIndex;

mmcssHandle = AvSetMmThreadCharacteristics(L"Capture", &mmcssTaskIndex);

AvSetMmThreadPriority(mmcssHandle, AVRT_PRIORITY_HIGH);

// initialize COM for the current thread
CoInitialize(nullptr);
Expand Down
2 changes: 1 addition & 1 deletion code/components/voip-mumble/src/MumbleAudioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ void MumbleAudioOutput::ThreadFunc()

mmcssHandle = AvSetMmThreadCharacteristics(L"Audio", &mmcssTaskIndex);

SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
AvSetMmThreadPriority(mmcssHandle, AVRT_PRIORITY_HIGH);

// initialize COM for the current thread
CoInitialize(nullptr);
Expand Down

0 comments on commit 0bf3d3e

Please sign in to comment.