| 175 | }; |
| 176 | |
| 177 | static short clip(float input) |
| 178 | { |
| 179 | int temp = (int)input; |
| 180 | /* clip on boundaries of 16-bit word */ |
| 181 | |
| 182 | if (temp < -32767) |
| 183 | { |
| 184 | //assert? |
| 185 | temp = -32767; |
| 186 | } |
| 187 | else |
| 188 | if (temp > 32767) |
| 189 | { |
| 190 | //assert? |
| 191 | temp = 32767; |
| 192 | } |
| 193 | |
| 194 | return (short)(temp); |
| 195 | } |
| 196 | |
| 197 | /* Convert from decibels to a linear scale factor */ |
| 198 | static float DBtoLIN(int dB) |
no outgoing calls
no test coverage detected