Skip to content
Snippets Groups Projects
Commit fc938bb2 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Reduce audio level by -12dB.

It was at absolute max (an extra one and it would clip) which is
really a terrible thing to do to people wearing headphones.

I don't really need to do it this way, but the math for the different
wave forms depends heavily on integer wrapping (and WAVE_SHAPE_SINE_HARM
is just stupid).
parent 599aea8e
Branches
Tags
No related merge requests found
Pipeline #7820 passed
...@@ -8,6 +8,7 @@ Better socket disconnect detection in SSH and telnets sessions ...@@ -8,6 +8,7 @@ Better socket disconnect detection in SSH and telnets sessions
Fix X11 mode scaling and fullscreen with minimal X servers Fix X11 mode scaling and fullscreen with minimal X servers
Massively improve output performance Massively improve output performance
Add option to configure audio output Add option to configure audio output
Lower audio output volume by 12dB
Version 1.4a Version 1.4a
------------ ------------
......
...@@ -277,6 +277,12 @@ void xptone_makewave(double freq, unsigned char *wave, int samples, enum WAVE_SH ...@@ -277,6 +277,12 @@ void xptone_makewave(double freq, unsigned char *wave, int samples, enum WAVE_SH
wave[i] += (sin ((inc * 3) * (double)i)) * 16; wave[i] += (sin ((inc * 3) * (double)i)) * 16;
break; break;
} }
/*
* TODO: It's silly to do this here, but the excessive wrapping above
* makes it the only sane way to do it and keep the noises as is.
*/
// Reduce by 12dB
wave[i] = ((((double)wave[i]) - 128) * 0.251) + 128;
} }
/* Now we have a "perfect" wave... /* Now we have a "perfect" wave...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment