Clamp and cast a float to i16
| 23 | |
| 24 | // Clamp and cast a float to i16 |
| 25 | i16 clampI16(float v) { |
| 26 | if (v > 32767.0f) v = 32767.0f; |
| 27 | if (v < -32768.0f) v = -32768.0f; |
| 28 | return static_cast<i16>(v); |
| 29 | } |
| 30 | |
| 31 | // Generate a multi-frequency audio::Sample (bass + mid + treble mixed) |
| 32 | audio::Sample makeMix(float bassAmp, float midAmp, float trebAmp, |
no outgoing calls
no test coverage detected