clang hates that I guess
This commit is contained in:
parent
9e3341f2f2
commit
4903d39eed
@ -387,7 +387,7 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
|
|||||||
mix = true;
|
mix = true;
|
||||||
|
|
||||||
float volume = speaker->volume;
|
float volume = speaker->volume;
|
||||||
Array2F levels = speaker->channelVolumes;
|
std::array<float, 2> levels = speaker->channelVolumes;
|
||||||
for (size_t i = 0; i != samples; ++i)
|
for (size_t i = 0; i != samples; ++i)
|
||||||
sharedBuffer[i] += (int32_t)(speakerBuffer[i]) * levels[i % 2] * volume;
|
sharedBuffer[i] += (int32_t)(speakerBuffer[i]) * levels[i % 2] * volume;
|
||||||
//Blends the weaker channel into the stronger one,
|
//Blends the weaker channel into the stronger one,
|
||||||
@ -441,11 +441,9 @@ void Voice::update(float, PositionalAttenuationFunction positionalAttenuationFun
|
|||||||
if (positionalAttenuationFunction) {
|
if (positionalAttenuationFunction) {
|
||||||
speaker->channelVolumes = {
|
speaker->channelVolumes = {
|
||||||
1.0f - positionalAttenuationFunction(0, speaker->position, 1.0f),
|
1.0f - positionalAttenuationFunction(0, speaker->position, 1.0f),
|
||||||
1.0f - positionalAttenuationFunction(1, speaker->position, 1.0f)
|
1.0f - positionalAttenuationFunction(1, speaker->position, 1.0f)};
|
||||||
};
|
} else
|
||||||
}
|
speaker->channelVolumes = {1.0f, 1.0f};
|
||||||
else
|
|
||||||
speaker->channelVolumes = Vec2F::filled(1.0f);
|
|
||||||
|
|
||||||
auto& dbHistory = speaker->dbHistory;
|
auto& dbHistory = speaker->dbHistory;
|
||||||
memmove(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float));
|
memmove(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float));
|
||||||
|
@ -89,7 +89,7 @@ public:
|
|||||||
atomic<bool> playing = 0;
|
atomic<bool> playing = 0;
|
||||||
atomic<float> decibelLevel = -96.0f;
|
atomic<float> decibelLevel = -96.0f;
|
||||||
atomic<float> volume = 1.0f;
|
atomic<float> volume = 1.0f;
|
||||||
atomic<Array<float, 2>> channelVolumes = Array<float, 2>::filled(1);
|
atomic<std::array<float, 2>> channelVolumes = std::array<float, 2>{1.0f, 1.0f};
|
||||||
|
|
||||||
unsigned int minimumPlaySamples = 4096;
|
unsigned int minimumPlaySamples = 4096;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user