diff options
author | Andreas Hubel <andreas.hubel@br.de> | 2021-01-23 21:24:47 +0300 |
---|---|---|
committer | Andreas Hubel <andreas.hubel@br.de> | 2021-01-23 21:24:47 +0300 |
commit | 437c2dfc7315ded20bf36a406d6c57b600839036 (patch) | |
tree | df60befca5a9554b397e274ca464b591f462b86b | |
parent | 76ababeb9b681148b9dfa744cc7b70d98366611f (diff) |
fix warning: implicit converstion from int to short turns value to -32768
-rw-r--r-- | src/MKAudioOutput.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/MKAudioOutput.m b/src/MKAudioOutput.m index 44e5458..9d47dcb 100644 --- a/src/MKAudioOutput.m +++ b/src/MKAudioOutput.m @@ -200,8 +200,8 @@ short *outputBuffer = (short *)frames; for (i = 0; i < nsamp * _numChannels; ++i) { - if (mixBuffer[i] > 1.0f) { - outputBuffer[i] = 32768; + if (mixBuffer[i] >= 1.0f) { + outputBuffer[i] = 32767; } else if (mixBuffer[i] < -1.0f) { outputBuffer[i] = -32768; } else { @@ -235,8 +235,8 @@ _cngLastSample = runningvalue; _cngRegister2 += _cngRegister1; - if (runningvalue > 1.0f) { - outputBuffer[i] = 32768; + if (runningvalue >= 1.0f) { + outputBuffer[i] = 32767; } else if (runningvalue < -1.0f) { outputBuffer[i] = -32768; } else { |