Commit Graph

1945 Commits

Author SHA1 Message Date
David Reid 065e6eadb5 Minor code rearrangement. 2026-01-06 18:18:16 +10:00
caturria 962d11b4ce Resource manager can now have a custom resampler. 2026-01-06 18:13:57 +10:00
David Reid b62249ceaf Fix an infinite loop bug. 2026-01-06 16:29:42 +10:00
David Reid 525b04db04 Make ma_sound node processing a bit more robust.
This removes the dependency on querying the required input frame count
from the resampler. This should in turn enable future work to support
custom resamplers.

Public issue https://github.com/mackron/miniaudio/issues/965
2026-01-06 16:11:35 +10:00
David Reid e93e1dbba1 Set up some infrastructure for improvements to ma_sound processing. 2026-01-06 15:15:43 +10:00
David Reid 111d620c63 Fix some node timing errors.
This commit fixes a bug relating to nodes with a scheduled start/stop
time. Whether or not the node is considered started or stopped is being
incorrectly reported by `ma_node_get_state_by_time_range()`.

Another issue is fixed in `ma_node_read_pcm_frames()`, which is related
to the fix above, where the frame count can underflow thereby resulting
in a crash.

Public issue https://github.com/mackron/miniaudio/issues/969
2026-01-06 13:05:40 +10:00
David Reid 3b4e87848b Fix a typo. 2026-01-06 10:11:16 +10:00
David Reid 35acd7a65b Relocate the sound end callback to after the sound is stopped.
Public issue https://github.com/mackron/miniaudio/issues/1013
2026-01-06 10:05:36 +10:00
David Reid 92fb865387 Update some comments. 2026-01-06 08:06:49 +10:00
François Hautier c44ec3f46a Better comment 2026-01-06 07:56:41 +10:00
François Hautier 8c3b213a7c WebAudio: Try to fix a startup noise 2026-01-06 07:56:41 +10:00
David Reid 88797e9dee Fix a double-uninit error with decoders.
Public issue https://github.com/mackron/miniaudio/issues/1080
2026-01-04 15:03:47 +10:00
David Reid ad85d0c3c4 Update dr_libs. 2026-01-04 14:37:14 +10:00
David Reid 364844231d Fix an bug with error recovery when failing to initialize a decoder.
Public issue https://github.com/mackron/miniaudio/issues/1080
2025-12-23 19:04:53 +10:00
David Reid 9ea38e9f3a Update dr_wav and dr_flac. 2025-12-14 06:38:32 +10:00
David Reid af19bdb6ff Fix a bug where MA_NO_DECODING would disable the WAV encoder.
Public issue https://github.com/mackron/miniaudio/issues/1076
2025-12-13 17:26:06 +10:00
David Reid 8c1dc255db Remove Cosmopolitan pre-processing checks.
https://github.com/mackron/miniaudio/pull/1070
2025-11-30 05:39:49 +10:00
Louis du Verdier 6d65be5e0e Do not set POSIX thread scheduler policy on systems reporting that they do not support it 2025-11-29 14:20:45 +10:00
Kjetil Berg 6a895501cf Fix: exclude Emscripten from ALSA support check on Linux 2025-11-29 08:58:30 +10:00
David Reid 787318fd8f Update dr_wav and dr_mp3. 2025-11-29 08:36:33 +10:00
David Reid 4a8467852a Fix a shadow declaration warning.
Public issue https://github.com/mackron/miniaudio/issues/1059
2025-11-29 08:34:40 +10:00
David Reid 80cf7b2deb Update dr_flac.
Public issue https://github.com/mackron/miniaudio/issues/1050
2025-09-28 08:10:20 +10:00
David Reid 2db0984566 Fix a possible crash in the resource manager.
This code was prematurely freeing a data buffer node which was resulting
in a dereference of an invalid pointer.
2025-09-27 12:34:21 +10:00
David Reid 669ed3e844 Update dr_mp3. 2025-09-24 16:04:56 +10:00
David Reid 81410769ae Update c89atomic.
There was a stray line continuation in a macro which was resulting in an
error with MSVC.
2025-09-19 13:03:10 +10:00
David Reid 089f041120 Update c89atomic.
Public issue https://github.com/mackron/miniaudio/issues/1045
2025-09-19 12:46:50 +10:00
David Reid 2e02046c6d Update dr_libs. 2025-09-19 12:45:59 +10:00
David Reid b3c6bcec39 Update change history and version number. 2025-09-14 07:39:08 +10:00
David Reid ed2c5270c8 Fix a typo. 2025-09-14 07:36:30 +10:00
Michael Müller 3dfcefc75b Fix access to miniaudio in ma_context_uninit__webaudio. 2025-09-14 07:26:31 +10:00
David Reid f40cf03f80 Version 0.11.23 2025-09-11 06:46:45 +10:00
David Reid 3afbdef285 Update dr_libs. 2025-09-10 18:56:36 +10:00
David Reid 9a091f73aa Fix an undefined behavior error in the s16 to s32 conversion routine. 2025-09-10 15:06:34 +10:00
David Reid 87bae56937 Fix typos in the documentation. 2025-09-10 13:18:58 +10:00
spevnev 9e1f02b12a Fix unsigned offset overflow 2025-09-10 06:44:31 +10:00
David Reid fa84240364 Fix a typo. 2025-09-09 17:27:25 +10:00
David Reid ea59076ba9 Try fixing a warning with MA_FALLTHROUGH. 2025-08-23 08:33:53 +10:00
David Reid f48d903526 WASAPI: Add a missing field to ma_AudioClientProperties.
Public issue https://github.com/mackron/miniaudio/issues/1028
2025-08-23 06:46:09 +10:00
David Reid 3bdd39fd2c Make some sound functions const.
Public issue https://github.com/mackron/miniaudio/issues/990
2025-08-23 06:20:08 +10:00
David Reid 3567d5cfef Fix compilation error with MA_NO_SSE2. 2025-08-20 16:04:15 +10:00
David Reid 4e3b778c62 Silence some warnings about unused functions. 2025-08-20 15:56:43 +10:00
David Reid 6315130ec6 Make ma_lcg.state uint32 to avoid UB on signed arthimethic overflow 2025-08-19 08:32:06 +10:00
David Reid 1ea69211ad Fix some errors with the DJGPP build.
This forces `MA_NO_THREADING` and `MA_NO_RUNTIME_LINKING`.

The DOS/DJGPP build currently requires `MA_NO_DEVICE_IO`.
2025-08-07 17:44:19 +10:00
David Reid e9e8f90137 Fix an error when setting loop points.
Public issue https://github.com/mackron/miniaudio/issues/1019
2025-08-07 16:20:00 +10:00
David Reid d93552283f Unify MA_NX and MA_SWITCH platform macros. 2025-08-07 16:17:51 +10:00
David Reid 61a85dca42 Fix NXDK build for Xbox.
This disables the WASAPI, DirectSound and WinMM backends which means
you will not get any actual audio output working. An Xbox backend will
need to come later. The main purpose of this commit is to get the main
library compiling.

The main complication arises from the fact that both _WIN32 and
_MSC_VER are defined which makes miniaudio think it's using a normal
desktop Windows build. In practice it mostly works, but there's a few
things needing to be changed specifically for NXDK:

  - `fopen_s()` is not a thing with NXDK. It always uses `fopen()`.
  - There is no `_wfopen()`, nor `wcsrtombs()`, so attempting to open
    a file from a wide character string will fail.
  - There is also no `CreateFileW()`, so this code path will also
    result in an error if you attempt to open a file from a wide
    character path.
  - `CoInitialize()` is not a thing with NXDK and has therefore been
    excluded from the build.
  - `GetFileInformationByHandle()` does not exist, and neither does
    `struct stat` or `stat()`. Since the only file information miniaudio
    attempts to retrieve is the file size, I've implemented a fall back
    which uses the seek/tell/seek pattern when info retrieval is
    unavailable.
  - A fall back has been implemented for comparing wide character path
    extensions which performs a case-sensitive compare instead. This
    means that if you are using wide character paths, miniaudio will not
    detect an extension like "wav" and "WAV" as the same thing. This
    might be made more robust later if there is enough demand.

Public issue https://github.com/mackron/miniaudio/issues/1023
2025-08-07 13:45:11 +10:00
David Reid c87f207f4e Win32: Use CreateSemaphore() instead of CreateSemaphoreW()
This should improve compiler compatibility for those that do not
define `CreateSemaphoreW()`, such as NXDK.
2025-08-07 13:23:35 +10:00
David Reid 02ae7e41f0 Update dr_libs. 2025-08-07 13:18:56 +10:00
David Reid 457a7279fa Update dr_wav. 2025-07-23 12:08:35 +10:00
David Reid 0b70a990ca Minor update to documentation. 2025-07-23 09:16:20 +10:00