瀏覽代碼

Allow negative/inverting mixer gain

fixes #115
dds
PaulStoffregen 9 年之前
父節點
當前提交
9a9014363b
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      mixer.h

+ 2
- 2
mixer.h 查看文件

@@ -40,7 +40,7 @@ public:
void gain(unsigned int channel, float gain) {
if (channel >= 4) return;
if (gain > 32767.0f) gain = 32767.0f;
else if (gain < 0.0f) gain = 0.0f;
else if (gain < -32767.0f) gain = -32767.0f;
multiplier[channel] = gain * 65536.0f; // TODO: proper roundoff?
}
private:
@@ -56,7 +56,7 @@ public:
void gain(unsigned int channel, float gain) {
if (channel >= 4) return;
if (gain > 127.0f) gain = 127.0f;
else if (gain < 0.0f) gain = 0.0f;
else if (gain < -127.0f) gain = -127.0f;
multiplier[channel] = gain * 256.0f; // TODO: proper roundoff?
}
private:

Loading…
取消
儲存