3570 Commits

Author SHA1 Message Date
David Reid e2db423078 Fix a memcpy error. 2023-02-24 08:12:52 +10:00
David Reid bc393dbba8 Experimental workaround for an Android bug in AAudio. 2023-02-01 13:27:43 +10:00
David Reid 6720b51194 Merge branch 'dev' of https://github.com/mackron/miniaudio into dev 2023-01-23 12:56:47 +10:00
David Reid 2d998e37a4 Experimental support for passthrough nodes with zero inputs. 2023-01-23 12:56:32 +10:00
Kaisei Sunaga 49e69ac0ee fix tab 2023-01-21 08:31:58 +11:00
Kaisei Sunaga a3b6797da3 fix compilation error 2023-01-21 08:31:58 +11:00
kaisei.sunaga 7c6366d9c2 add AAudioStreamBuilder_setAllowedCapturePolicy 2023-01-21 08:31:58 +11:00
cdigit 6de98570f6 Update duplex_effect.c 2023-01-14 10:33:24 +11:00
David Reid 981e1ddac7 Fix an error in the documentation. 2023-01-12 14:31:09 +10:00
David Reid 324ebe2500 Update documentation. 2023-01-07 20:11:44 +10:00
David Reid e0a9bf1b69 Fix some invalid code in example. 2023-01-06 11:03:46 +10:00
David Reid 31e139668d Update readme. 2023-01-06 10:54:43 +10:00
David Reid 7ff8505d3b Update backends table. 2023-01-06 10:51:23 +10:00
David Reid 293d7a68c2 Minor code rearrangement. 2023-01-06 10:36:31 +10:00
SeanTolstoyevski d89717216e revert public api for ma_apply_volume_unclipped_f32 2023-01-06 11:31:39 +11:00
SeanTolstoyevski 512d7c6660 change to public api for ma_mix_pcm_frames_f32 & ma_apply_volume_unclipped_f32 2023-01-06 11:31:39 +11:00
David Reid 4bb8808bfb Remove an unnecessary restriction on splitters. 2023-01-05 09:37:39 +10:00
David Reid c371291510 Update change history. 2023-01-03 19:16:09 +10:00
David Reid 78897b3e95 Don't try using the DirectSound backend if not all APIs are available.
This affects Windows 95. It does not appear to have at least one of
these functions. This is convenient because the function
IDirectSound::CreateSoundBuffer() is failing in my tests and I wasn't
able to figure out what was going on. Simply failing context
initialization outright is an acceptable solution for now since
Windows 95 is such an uncommon target and it can always fall back to
WinMM which works.
2023-01-03 19:10:14 +10:00
David Reid fcdd14cd61 Fix crash when running on Windows 95.
It looks like CoInitializeEx() is not available on Windows 95. This
commit changes it so that if CoInitializeEx() cannot be found, such as
the case with Windows 95, it falls back to CoInitialize().

As of this commit, a crash still occurs when trying to initialize the
DirectSound backend. The WinMM backend works, however.
2023-01-03 18:28:25 +10:00
David Reid f648c9b298 Get playback working on Windows 98 with the DirectSound backend.
This change adds a fallback for when setting the format of the primary
buffer fails. I have observed this happening with floating point
formats so I've forced the use of integer PCM formats in the fallback
case. I've also restricted it to 44100 because when I tried 4800 on
my Windows 98 machine it resulted in incorrect output.
2023-01-03 16:16:39 +10:00
David Reid 0887aab98b Fixes for improving support on Windows 98.
There are two things addressed with this commit:

  * The use of CreateEventW() will fail at runtime on Windows 98. The
    "A" version needs to be used instead.

  * CreateThread() fails on Windows 98 if the last parameter is NULL.
    This parameter takes a pointer to a DWORD which receives the
    thread ID.

As of this commit, the DirectSound backend does not work on Windows 98.
2023-01-03 15:30:03 +10:00
David Reid 69e70c1c98 Update change history. 2022-12-28 07:38:39 +10:00
David Reid 0d6db3e07f Fix a seeking error with the stb_vorbis decoding backend.
The issue with this one was that the brute-force path was seeking back
to the start of the file rather than seeking to the start of the audio
data within the file.
2022-12-28 07:27:24 +10:00
David Reid 2abcd88b72 Fix a bug where loading a stream could incorrectly return successfully.
This also makes a small change to Vorbis seeking which could
potentially address an issue where seeking isn't quite accurate.
2022-12-26 08:50:00 +10:00
David Reid 3167935864 Update changes. 2022-12-24 08:44:36 +10:00
David Reid 37b2e5157f Fix a bug with asynchronously loaded sounds and ranges and looping.
The issue with this one is that it was possible for the asynchronous
loading process to override settings that were explicitly set via
ma_data_source_set_*(). The fix for this is to only set these on the
asynchronous side if the values in the resource manager's data source
config is not equal to defaults.
2022-12-24 08:37:21 +10:00
David Reid 7bd319d9ee Fix a bug relating to changing the range of a data source.
The issue here is that the code is trying to maintain the absolute
position of the loop point. The problem with this is that the absolute
position of the loop points could fall outside the new range which
would then result in no audio being read.

This becomes an issue because it would effect data sources even when
the loop point was never actually explicitly set. From these users
perspective, changing the range completely breaks their audio.

The new system simply resets the loop points. This works for users who
are using the default loop points (the majority of cases). For those
who are explicitly setting a loop point, they simply need to reset
their loop points after changing the range. This is not really an
issue, because loop points are relative to the range, which means a
change in the range would most likely warrant a change in the loop
point anyway.
2022-12-24 08:05:56 +10:00
David Reid 49a95a326b Fix a bug with data source ranges.
Public issue https://github.com/mackron/miniaudio/discussions/596
2022-12-21 07:42:50 +10:00
David Reid 9dfa5620a5 Include <android/log.h> when debug output is enabled. 2022-12-20 15:52:41 +10:00
David Reid 02e6ca8f93 Clarification to some documentation. 2022-12-18 10:44:15 +10:00
David Reid a823583386 AAudio: Improve handling of stream errors.
Public issue https://github.com/mackron/miniaudio/issues/590
2022-12-15 08:45:15 +10:00
David Reid 28cab3e952 Update dr_wav. 2022-12-15 07:55:12 +10:00
David Reid 6d46ddf51a Update build instructions for iOS. 2022-12-15 07:31:46 +10:00
David Reid 7e2390777c Remove another unnecessary volatile. 2022-12-11 21:12:31 +10:00
David Reid b000c3fbec Remove some unnecessary volatiles. 2022-12-11 21:10:42 +10:00
David Reid 4926e118bc Add an optimized rsqrt implementation for SSE-enabled builds. 2022-12-11 11:56:12 +10:00
David Reid 69f4c65bf9 Fix some atomicity errors with the spatializer. 2022-12-11 10:44:35 +10:00
David Reid 4b4c5f5d97 Fix an out of date example. 2022-12-05 10:24:45 +10:00
David Reid bfde669130 Fix a warning. 2022-12-03 11:18:43 +10:00
David Reid 9e88290aae A couple of const correctness improvements.
Public issue https://github.com/mackron/miniaudio/issues/584
2022-12-03 11:18:11 +10:00
David Reid ef08bb0dcd Fix a typo. 2022-12-03 11:11:54 +10:00
David Reid 6770ab167d Update documentation. 2022-12-03 11:10:35 +10:00
David Reid b7159b76d5 Update ma_noise_set_type() to prevent a crash.
Updating the noise type should not be supported. An oversight on my
part. Users should reinitialize a fresh `ma_noise` object instead.

This change simply returns an error and triggers an assert in debug
mode.

Public issue: https://github.com/mackron/miniaudio/issues/585
2022-12-03 11:07:34 +10:00
David Reid bd1c156e5f Update change history. 2022-12-01 10:35:39 +10:00
David Reid fc424d9ffa Some minor code cleanup. 2022-12-01 10:33:50 +10:00
Patrick Stewart c3aae67b84 Add fallthrough attribute to fix build with Wimplicit-fallthrough on mac 2022-12-01 11:20:42 +11:00
David Reid 58219ed84c Add some hand-written SSE2 code. 2022-11-24 16:45:41 +10:00
David Reid 8db30c3673 Optimized paths for stereo and 5.1 for mono expansion. 2022-11-24 15:52:03 +10:00
David Reid c99cb2b901 Channel conversion optimization for mono expansion. 2022-11-24 14:48:45 +10:00