bjorn
917b97ca2d
Adjust;
2022-07-03 21:48:43 -07:00
mcc
28d64b6ced
Fix various compiler warnings in MSVC (non graphics edition)
...
- Put in casts/checks in audio code when assigning size_t to 32 bit
- () is different from (void)
- Turned off warnings for anonymous unions and negating unsigned integers which were technically accurate but unhelpful (and interfered with bit conversion and a weird bit math construct in audio.c) (CMakeLists only)
2022-07-03 21:34:16 -07:00
bjorn
aa929482cd
Fix default air absorption;
2022-05-31 13:55:38 -07:00
bjorn
d70619ec96
Source:isSpatial; Separate spatial from effects;
2022-03-27 19:09:25 -07:00
bjorn
a1d0b2fa11
Use fixed-size audio callbacks;
...
WebAudio may need...attention.
2022-03-23 10:57:30 -07:00
bjorn
20caeca69a
Upgrade miniaudio;
2022-03-23 10:57:30 -07:00
bjorn
b7527c3584
More people use COUNTOF;
2022-03-22 17:56:26 -07:00
bjorn
2da18d419b
mv util src;
2022-03-22 00:13:38 -07:00
bjorn
6f3e46d8cf
Fix some pointer formatting;
2022-02-02 12:01:38 -08:00
bjorn
998b355e30
Make some private functions static;
2021-10-31 12:35:49 -07:00
bjorn
ebeee33298
Fix lovrAudioGetSampleRate prototype;
2021-10-31 12:09:33 -07:00
bjorn
1fdaa797ac
Error on enabling an effect on a Source with effects disabled;
2021-08-12 11:25:51 -07:00
mcc
9f96917d91
Fix horizontal rotation bug in Oculus spatializer
2021-07-26 11:24:04 -07:00
mcc
db28be591a
Fix incomplete LOVR_ENABLE PHONON/OCULUS define change
2021-07-23 09:55:16 -07:00
mcc
52db969622
Remove DEFAULT_SAMPLE_RATE
2021-07-20 11:28:48 -07:00
mcc
a0a242a610
Fix types/naming to standard style
2021-07-20 11:28:48 -07:00
mcc
56138492f2
Allow get sample rate in conf.lua, read back with lovr.audio.getSampleRate()
2021-07-20 11:28:48 -07:00
mcc
2a73310198
Fix distance attenuation in Oculus spatializer
2021-07-20 11:23:32 -07:00
bjorn
ecd7769ba0
Convert Tupfile to Lua;
2021-07-18 22:24:00 -07:00
mcc
39dca2f093
Fix lovr.audio.setPose() in oculus spatializer mode
2021-07-18 20:39:46 -07:00
bjorn
0a9956db60
phonon: Fix crash when setGeometry fails;
...
The call to `free` above was fixed, but the one in the error case
was not.
2021-04-27 22:15:15 -06:00
mcc
d558996206
Hold lock when changing geometry (prevents crash, see issue #403 )
2021-04-12 13:01:54 -06:00
bjorn
5106aaf74c
Audio listener/source default to identity orientations;
2021-04-03 18:38:27 -06:00
bjorn
609d7e05ce
simple spatializer supports directivity;
...
Also coming soon to an oculus spatializer near you.
2021-04-03 18:22:23 -06:00
bjorn
19620c7682
wasm: Use default miniaudio buffer size.
...
Audio currently stutters on the wasm build. It is much more severe
in Chrome than in Firefox (very rare/subtle in Firefox). miniaudio
is currently using ScriptProcessorNode, which is deprecated because
it processes audio on the main thread. There's a new API that lets
you programmatically process audio on a thread called AudioWorklet,
but it's hella complicated. miniaudio doesn't want to support this
because it's complicated and requires a separate JavaScript request
but it seems like it would be possible to work around using a Blob.
In the meantime, miniaudio bumps up the buffer size on WebAudio, so
let's just use that in hope that it helps.
2021-04-03 18:04:26 -06:00
bjorn
024498b964
Source:clone fixes;
...
Clones no longer try to create converters if they aren't needed, which
was causing an error.
Also handle malloc failure.
2021-04-03 09:49:27 -06:00
bjorn
4469fc99e8
Fix mixer bug; Refactor mixer;
...
- Sources without converters always read into the beginning of the
raw buffer, overwriting previous frames if the source was rewound
due to looping. This resulted in an audible click whenever the
source was rewound.
- After looping, Sources without converters would try to read too
many frames -- they would read a full buffer instead of only the
necessary number of frames.
2021-04-02 23:36:30 -06:00
bjorn
6ae0d9f96a
phonon works by default when no mesh is provided;
2021-04-02 23:35:18 -06:00
mcc
6b099e467f
Encapsulate "uses spatializer?" nature in lovrSourceUsesSpatializer
...
Also, remove accessor prototype for old IsSpatial() function
2021-04-02 14:16:39 -06:00
bjorn
82a309a56d
Draft new effects API;
...
- A list or map of effects can be provided to newSource.
- false can be used to bypass effects.
- All effects are enabled by default.
- Occlusion-y effects should only take effect when setGeometry is called
- Spatializer is responsible for ensuring this.
2021-04-01 16:46:16 -06:00
bjorn
cfe0d71520
audio: throw if miniaudio fails to initialize;
...
This prevents a situation where miniaudio fails to initialize but the
audio module is still usable.
2021-03-31 14:01:30 -06:00
bjorn
eb8b559e88
phonon: Fix freeing incorrect variable;
2021-03-30 12:45:24 -06:00
bjorn
948b77b7fa
phonon doesn't try to make a mesh if there are no vertices;
2021-03-26 10:30:08 -06:00
bjorn
634e7210bf
Make Source:clone suck less;
2021-03-23 14:31:04 -06:00
bjorn
5ef5ac5f22
I am once again fixing the mixer EOF case;
2021-03-23 14:31:04 -06:00
bjorn
6a79ffb34a
rm Source::blend;
2021-03-23 14:31:04 -06:00
bjorn
de5099badd
rm SourceInterpolation;
2021-03-23 14:31:04 -06:00
bjorn
98f33dc131
mv falloff attenuation;
2021-03-23 14:31:04 -06:00
bjorn
b1f7a6c11d
Add optional VolumeUnit to get/setVolume functions;
...
Volume can be specified in linear units or dB.
2021-03-19 17:20:48 -06:00
bjorn
c1c15c46db
Don't share ma_data_converters between Sources;
...
It causes distortions when resampling is involved.
2021-03-18 16:31:14 -06:00
bjorn
96e0cc8b9b
Fix mixer bug when reaching end of source;
2021-03-18 13:47:04 -06:00
bjorn
369bd5d8b4
Clamp source/listener volumes to 0-1 range;
...
Prevents miniaudio errors and horrible clipping on bad input.
2021-03-18 13:06:11 -06:00
bjorn
f9f4907a50
phonon fixes;
2021-03-07 22:42:54 -07:00
bjorn
0435694225
simple spatializer interpolation;
...
prevents snaps, crackles, and pops
2021-03-07 21:19:25 -07:00
bjorn
30a0556f1d
Fix oculus spatializer;
2021-03-07 21:19:24 -07:00
bjorn
0c3351331e
Sink attempt;
2021-03-03 20:01:56 -07:00
bjorn
f806c07bfa
Simplify spatializer interface temporarily;
2021-03-03 15:49:28 -07:00
bjorn
bc41eecf09
oculus spatializer: free memory; use MAX_SOURCES
2021-03-03 15:46:01 -07:00
bjorn
8188e51060
lovr.audio.get/setAbsorption;
...
I HOPE THIS LETS US DO UNDERWATER EFFECT
2021-03-03 15:40:27 -07:00
bjorn
2c0875087f
Source:getSound;
2021-03-03 15:32:41 -07:00