do rounding to nearest in freq_marker

pull/6/head
Ahmet Inan 2015-01-09 18:12:23 +01:00
rodzic 923baf5846
commit 55da5a9d77
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -36,7 +36,7 @@ static inline uchar4 rainbow(float v)
static void freq_marker(int freq)
{
for (int j = 0; j < spectrum_height; ++j) {
int i = (radix2_N * freq) / sample_rate;
int i = (radix2_N * freq + sample_rate / 2) / sample_rate;
spectrum_buffer[spectrum_width * j + i] = rgb(255, 255, 255);
}
}