Clownacy
732d3bbc5c
Split software audio mixer to its own file
...
This will be shared between the SDL2 and miniaudio backends,
eliminating all that digusting duplicate code.
2020-03-31 12:14:20 +01:00
Clownacy
4e58457e1d
Make miniaudio backend use native sample rate
...
This avoids the need for miniaudio to resample the mixer's output.
2020-03-31 10:20:20 +01:00
Clownacy
dd04977f29
Update miniaudio to v0.10.1
...
This newer version supports marking all of its declarations as
static, avoiding the conflict between the miniaudio audio backend,
and the copy of miniaudio embedded in clownaudio in the enhanced
branch.
2020-03-17 13:25:41 +00:00
Clownacy
9af25f7c67
Hopefully fixed miniaudio backend on Windows
...
Stupid BOOL type
2020-03-04 21:02:17 +00:00
Clownacy
af24d010a5
Clean-up miniaudio backend a little
...
Really need to figure out the best way to abstract-away the software
mixer...
2020-02-29 18:19:06 +00:00
Clownacy
8ec8a8d990
Added unfinished miniaudio audio backend
...
Currently only works with CMake
2020-02-29 18:18:59 +00:00
Gabriel Ravier
b238bcee03
Remove random lines mistakenly added by merge
2020-02-14 08:27:07 +01:00
Gabriel Ravier
65db12baaa
Started trying to optimize MakePixelWaveData
2020-02-13 19:55:39 +01:00
Clownacy
f82a53d336
Prevent errors encountered by MSVC
2020-02-09 18:47:50 +00:00
Clownacy
2e5e1994c2
Enable debug console prints in non-debug builds
2020-02-03 16:44:52 +00:00
Clownacy
e3db7749ba
Add verbose error-reporting to backends
...
Should fix #98
2020-02-01 12:22:44 +00:00
Clownacy
788697dc5d
Fix a possible hang in the audio mixer
...
It was likely a race condition between the game thread writing to
'organya_timer', and the audio thread reading it.
...I really need to rethink the API for this Organya-synchronisation
thing.
2020-01-29 23:21:27 +00:00
Clownacy
e4394aea1f
Whoops, forgot to remove this #include
2020-01-29 22:16:21 +00:00
Clownacy
d0defa4a7b
This cast shouldn't be necessary
2020-01-29 22:15:53 +00:00
Clownacy
638e96be11
Move and rename attrHot
...
Like the MIN and MAX macros, I'd rather keep this in the source file
than a common header.
2020-01-29 22:14:35 +00:00
Gabriel Ravier
5e6658847c
Re-add missing "(double)"
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-29 23:04:17 +01:00
Gabriel Ravier
88a8362f23
Reverted fmodf stuff and tried to make it so C++ compilers would go for the float version in appropriate circumstances (fmodf directly is unavailable due to not being in C89)
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-01-29 23:01:31 +01:00
Gabriel Ravier
1442299924
Made MixSounds be marked as hot
...
Signed-off-by: Gabriel Ravier <gabrielravier@gabrielAncientIBMv2>
2020-01-29 23:01:31 +01:00
Gabriel Ravier
c15ecbf728
Used fmodf instead of fmod for a 0.5% performance increase in MixSounds
...
Signed-off-by: Gabriel Ravier <gabrielravier@gabrielAncientIBMv2>
2020-01-29 23:01:31 +01:00
Clownacy
79886f5ae4
Add debug prints for listing SDL2 drivers
...
These list what video/render/audio backends are available, and which
are currently being used.
SDL2 allows you to choose a specific video/audio driver with the
SDL_VIDEODRIVER and SDL_AUDIODRIVER environment variables,
respectively, but there's no such option for the render driver.
2020-01-20 15:27:05 +00:00
Clownacy
449a09b09e
Fix an occational invalid memory read
...
Stupid floating-point rounding errors. Had to undo a fancy
optimisation to avoid it.
2020-01-09 09:10:24 +00:00
Clownacy
bbf77f9cfd
Capitalise a macro
2020-01-04 20:57:36 +00:00
Clownacy
01c5fb3a37
Shut up another warning
2019-10-29 12:25:03 +00:00
Clownacy
b6f8bf68ec
Minor audio backend cleanup
2019-09-16 23:08:05 +00:00
Clownacy
949bfd129b
Allow SDL2 to change the audio frequency
...
The mixer can handle arbitrary frequencies, so there's no point in
forcing SDL2 to use 44100Hz.
2019-09-10 22:11:31 +00:00
Clownacy
aede7b6069
Restore the FREQUENCY constant
...
Cave Story at 2000Hz is fun
2019-09-10 14:04:06 +00:00
Clownacy
657b586cd1
Add missing #include to audio backend
...
Another GabrielRavier fix.
2019-09-10 12:36:55 +00:00
Clownacy
355b303635
Shut up some warnings
2019-09-10 01:53:19 +01:00
Clownacy
3eb346ce10
Synchronise the audio callback with Organya
...
This is the 'perfect' Organya playback I mentioned in the commit
message for 5ea356a3bd
2019-09-09 21:43:33 +00:00
Clownacy
a076274864
Make a clamp macro safer
2019-09-09 20:24:09 +00:00
Clownacy
a220732aac
Shut up some warnings
2019-09-06 20:03:35 +01:00
Clownacy
0dc9bb6b1b
Change the audio backend API again
2019-09-06 14:46:31 +00:00
Clownacy
ce055c12cb
Remove a now-unused function
2019-09-05 03:17:20 +00:00
Clownacy
a3bb651194
Change the audio backend API a little
...
AudioBackend_SetSoundPosition was very loosely-defined.
2019-09-04 03:16:33 +01:00
Clownacy
5ea356a3bd
Weed out a lot of the Windows dependency
...
Storytime: Cucky's original SDL2 port work involved using SDL2's
threading API to emulate the original WinAPI threading.
I can't be assed with that stuff, so I used the same trick Cucky did
for the Wii port, and hooked Organya up to the SDL2 audio callback.
This actually opens up the possibility for perfectly-synchronised
Organya playback. By that I mean, instead of needing a super
low-latency audio callback, I can have the callback synchronise its
audio mixing with Organya itself. I haven't done it yet, I plan to
soon.
2019-09-04 00:28:23 +01:00
Clownacy
5a9492166d
Restored the new SDL2 audio system
...
While I was at it, I overhauled the thing and found a bunch of
optimisations,
2019-09-03 22:29:57 +01:00