summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--genwav.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/genwav.c b/genwav.c
index d2298fe..1fd6fae 100644
--- a/genwav.c
+++ b/genwav.c
@@ -119,14 +119,7 @@ void mod_fm(struct wav_header *header, int16_t data[], double(*func)(double), do
length = D_LEN(header,length);
if (frequency == 0) return;
for (int i = 0; i < length; i++) {
- int16_t val = amplitude*(*func)(2.0*PI*(i+data[i])*(frequency/header->sample_rate));
- if ((data[i] > 0 && data[i] + val < val) || (val > 0 && data[i] + val < data[i])) {
- data[i] = 0x7fff;
- } else if ((data[i] < 0 && data[i] + val > val) || (val < 0 && data[i] + val > data[i])) {
- data[i] = 0xffff;
- } else {
- data[i] = val;
- }
+ data[i] = amplitude*(*func)(2.0*PI*(i+data[i])*(frequency/header->sample_rate));
}
}