Skip to content

Commit

Permalink
FORMAT(client): Clang format AudioOutput.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicalert committed Jun 11, 2021
1 parent c9ed961 commit 6aedbab
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/mumble/AudioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,17 +589,17 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) {
}

if (!aop->piOffset) {
aop->piOffset = std::make_unique<unsigned int []>(nchan);
aop->piOffset = std::make_unique< unsigned int[] >(nchan);
for (unsigned int s = 0; s < nchan; ++s) {
aop->piOffset[s] = 0;
}
}

for (unsigned int s = 0; s < nchan; ++s) {
const float dot = bSpeakerPositional[s]
? connectionVec.x * speaker[s * 3 + 0] + connectionVec.y * speaker[s * 3 + 1]
+ connectionVec.z * speaker[s * 3 + 2]
: 1.0f;
const float dot = bSpeakerPositional[s]
? connectionVec.x * speaker[s * 3 + 0] + connectionVec.y * speaker[s * 3 + 1]
+ connectionVec.z * speaker[s * 3 + 2]
: 1.0f;
// Volume on the ear opposite to the sound should never reach 0 in the real world.
// The gain is multiplied by 19/20 and 1/20 is added. This will have the effect
// of bringing the lowest value up to 1/20, while keeping the highest value at 1.
Expand All @@ -621,7 +621,8 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) {
// newly calculated offset for this chunk. This prevents clicking / buzzing when the
// audio source or camera is moving, because abruptly changing offsets (and thus
// abruptly changing the playback position) will create a clicking noise.
const int offset = INTERAURAL_DELAY * (1.0 + dot) / 2.0; // Normalize dot to range [0,1] instead [-1,1]
const int offset =
INTERAURAL_DELAY * (1.0 + dot) / 2.0; // Normalize dot to range [0,1] instead [-1,1]
const int oldOffset = aop->piOffset[s];
const float incOffset = (offset - oldOffset) / static_cast< float >(frameCount);
aop->piOffset[s] = offset;
Expand Down

0 comments on commit 6aedbab

Please sign in to comment.