168 Commits

Author SHA1 Message Date
Devin Braune
0e9ce1aa83
Fix cone angle calculation (#605) 2021-10-14 11:18:54 -07:00
Chris Robinson
92b65fa15f Avoid manually prefixing EventType_ enums
And use a better fitting type that matches how it's used
2021-10-10 05:07:31 -07:00
Chris Robinson
e3b8f8fe27 Make a construct_at method amd use it 2021-10-08 11:05:36 -07:00
Chris Robinson
fb1ad483d3 Ensure unused output channels are cleared when rendering 2021-07-24 18:15:02 -07:00
Chris Robinson
d998c03a27 Add a UHJ-specific coefficient scaling array 2021-07-13 06:31:13 -07:00
Chris Robinson
41add63728 Don't attenuate spatialized multichannel sources
It's inconsistent behavior with spatialized B-Format sources, and causes a very
apparent gain disparity between such a source on the listener compared to just
barely off-origin. It's also not something an app can easy correct for if it
doesn't want that behavior, since the source gain clamps to 1 by default. In
contrast, an app can attenuate sources as they want with little issue.
2021-06-24 08:21:25 -07:00
Chris Robinson
debb932573 Add an option to mix directly in the JACK callback 2021-06-08 10:52:37 -07:00
Chris Robinson
58a9549a58 Handle the listener position separate from the rotation matrix
It's too unstable with larger vectors. Even when the source and listener
positions are the same, floating point precision can cause noticeable rounding
errors.
2021-05-25 14:08:16 -07:00
Chris Robinson
ff380298e4 Move BufferStorage and Voice to core 2021-04-27 08:26:42 -07:00
Chris Robinson
99157f149f Move ContextBase and VoiceChange to core 2021-04-27 08:04:09 -07:00
Chris Robinson
26c8c50c26 Partially implement an extension to hold sources on disconnect
Rather than stopping voices/sources when the device becomes disconnected, the
context can be set to leave them alone. As a consequence, their state will
remain as playing and they'll keep their last known sample offset indefinately.
For applications mindful of this behavior, it will allow resetting or reopening
the device to reconnect and automatically resume where it left off.
2021-04-26 20:25:24 -07:00
Chris Robinson
22a8ebff80 Move GetChannelIdxByName and clean up some more includes 2021-04-26 08:04:50 -07:00
Chris Robinson
2479483645 Move bformatdec to core 2021-04-25 18:08:08 -07:00
Chris Robinson
8d09d03ed3 Move async_event.h to core 2021-04-25 14:29:21 -07:00
Chris Robinson
0fe38c053d Move some functions to core
And clean up more includes
2021-04-25 11:36:37 -07:00
Chris Robinson
b54bb388a3 Create a base the ALCdevice and ALCcontext structs
A base that contains the API-agnostic data, with ALCdevice and ALCcontext being
for AL-specific data.
2021-04-24 08:28:13 -07:00
Chris Robinson
65b85f7cb9 Move hrtf.cpp/h to core 2021-04-22 10:26:20 -07:00
Chris Robinson
c6dbc487b3 Rename Uhj2Encoder to UhjEncoder 2021-04-01 05:37:54 -07:00
Chris Robinson
f33edc3b30 Add support for 4-channel UHJ
Also add the SOFT moniker to the new macros
2021-03-31 21:02:30 -07:00
Chris Robinson
b5e36007f1 Handle 3-channel UHJ audio buffers 2021-03-31 10:03:31 -07:00
Chris Robinson
35a0f2665f Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
2021-03-31 09:37:30 -07:00
Chris Robinson
8793055e66 Start an interface for providing UHJ audio
Currently only 2-channel UHJ, which gets treated as stereo.
2021-03-31 05:37:56 -07:00
Chris Robinson
727503acdb Avoid making BSincPointsMax public 2021-03-01 17:48:07 -08:00
Chris Robinson
6e676b81d5 Avoiding cutting all bsinc resampler output at scale 0
This is mostly for the SampleConverter, used by some capture backends. When
recording at really low rates, like 5512hz, with a device capturing at a higher
rate like 44100hz or 48000hz, it hits the filter's downscaling limit and
produces pure silence.

In such cases, it's better to just accept some aliasing noise so that the app
will still get some recognizable audio. The alternative would be to scale the
desired rate by 2x, 3x, etc until it's above the bsinc limit, then take every
2nd, 3rd, etc sample of the result as if by an extra simpler resampler pass.
2021-02-24 22:21:18 -08:00
Chris Robinson
dfe627133c Use spans instead of references to arrays 2021-02-06 14:39:30 -08:00
Chris Robinson
3702ee669b Add a panning "deadzone" for spatialized sources
It is now the greater of 'epsilon' (1 / 2**23) or ref_distance/1024.
2021-01-28 08:36:49 -08:00
Chris Robinson
20f5e7c1fa Avoid global constexpr arrays 2021-01-21 04:03:30 -08:00
Chris Robinson
20ef8bf390 Move cpu_caps and fpu_ctrl to core 2020-12-31 16:47:12 -08:00
Chris Robinson
04358890d9 Use a unique_ptr to hold DistanceComp data 2020-12-27 11:30:45 -08:00
Chris Robinson
cd2ebb9c3a Use a uint for a bitfield 2020-12-27 01:05:16 -08:00
Chris Robinson
54719de132 Avoid AL enums for the EffectSlot type 2020-12-26 09:21:30 -08:00
Chris Robinson
204f7d8811 Rename From2D to FromACN2D 2020-12-25 06:40:13 -08:00
Chris Robinson
efc9c146c3 Move AsyncEvent to a separate header 2020-12-16 13:58:51 -08:00
Chris Robinson
02be0149f1 Send stop events when stopping paused voices 2020-12-16 02:12:18 -08:00
Chris Robinson
c96b50fb65 Use a separate enum for the VoiceChange state 2020-12-16 01:40:15 -08:00
Chris Robinson
5ad28f8cba Move VoiceChange to a separate header 2020-12-16 00:50:50 -08:00
Chris Robinson
304ab8d890 Avoid a generic event struct 2020-12-15 21:32:01 -08:00
Chris Robinson
a08f68f213 Avoid some AL types 2020-12-15 20:48:21 -08:00
Chris Robinson
daf9d46478 Use a separate structure for the context/listener params 2020-12-15 18:41:50 -08:00
Chris Robinson
e179bf0a12 Move the mixer functions to core 2020-12-12 14:58:09 -08:00
Chris Robinson
176bc8a835 Avoid passing DirectHrtfState to MixDirectHrtf 2020-12-12 13:52:14 -08:00
Chris Robinson
191fe888b4 Move ambidefs.h to core 2020-12-12 10:38:24 -08:00
Chris Robinson
2b919eac78 Use an alias for the DevFmtType type 2020-12-05 02:44:19 -08:00
Chris Robinson
50e33ce8f4 Change some macros into constexpr variables 2020-12-04 13:53:56 -08:00
Chris Robinson
c4132b80ed Move a couple more things to core 2020-12-04 13:13:52 -08:00
Chris Robinson
69d55d7e03 Move the filters to core 2020-12-04 11:15:50 -08:00
Chris Robinson
84d47f7d4c Move the bsinc tables to core 2020-12-04 11:15:50 -08:00
Chris Robinson
36c1589c11 Move mastering.cpp/h to core 2020-12-04 11:15:50 -08:00
Chris Robinson
aa05feec4a Avoid a global MAX_PITCH macro 2020-12-04 11:15:50 -08:00
Chris Robinson
8750810f5c Change a couple macros into constexpr variables 2020-11-28 03:38:20 -08:00