To replace sdl3_mixer that does no longer support MIDI playback, thus
unusable for our use case.
- song1 needs to be static included potentially from 2 compilation units -
this and sdl_mixer
Corrected various spelling mistakes in comments, documentation, and
variable names across the project. Changes include:
- Documentation files (CONTRIBUTING.md, README.md, etc.)
- Source code comments in C/C++ files
- Function parameter names and descriptions
No functional changes were made.
Use static_assert to ensure little endian instead of the preprocessor
checks - if the those macros are not defined by the compiler, the check
will be eliminated. If other complier is used, write this more
generically.
Where the PACKAGE_BUGREPORT is the only used item from config.h,
use bug_msg(), which can be then removed.
Improved bug_msg() to allow printf-like fomat + arguments.
The loading of samples with negative value was not working properly
because of sign expansion. The storing works fine, because samples are
only ever written with the same or less BPS.
This reverts commit 586c3fc585.
handle 1 byte case, which is unsigned and thus mus be handled separately
\+ divide the other cases with -INT32_MIN instead of INT32_MAX, to avoid
value < -1.0 if the sample value is INT32_MIN (but as the computation is
done in floats, both values will likely to be rounded to the same number)
Make working compressions other than Opus, taking sample format other
than S16 (interleaved).
Accept also S16P and FLTP (needed for AAC, MP3, Vorbis).
\+ also process stereo input (as currently only mono are accepted)
- not used
- in documentation there was incorrectly stated that in and out can
overlap; perhaps a C&P from int2float doc because it doesn' seem to be
true - first written float overrides second read short so on
* Replace bit shift with integer division - Shifting doesn't behave
nicely for negative numbers, for example -2 >> 8 equals -1. This
introduces distortion
* Use rounding from 0.5 up - Truncating introduces distortion, because
the interval of numbers that round to 0 is disproportionaly big (-1, 1).
* Replace random number generation with a faster algorithm
With all theese changes, the code is also a bit faster.
By reducing bit-depth of audio, quantization noise is introduced. If the
bit depth is reduced by consistent rounding (either always down, always
up, or always to nearest) the quantization noise is correlated with the
input signal and percieved as distortion. Adding a small amount of noise
to the input signal before reducing the bit-depth causes random
rounding, which makes the noise uncorrelated and uniformly spread
through the whole spectrum.
This avoids pops and buzzing caused by integer overflow when the input
sample falls outside of the range [-1.0, 1.0] (I encountered this when
using jack capture).
- added (const char *) attribute to param_u union to avoid casting away
const warnings
- added also (const void *) and (volatile void *) for the rest
- there was a typo in computing requested_mtu causing violating sequence
point evaluation order
- alsa_get_pcm_state_name: added attribute unused
- audio/utils.cpp: different signdness
- audio/utils.cpp: different signdness
- split capture filter: useless dispose_frame
- video_compress: not copying whole string (with strncpy)