Commit Graph

3812 Commits

Author SHA1 Message Date
Andrew Opalach e15fd218be WASAPI: Fix drain on device stop 2025-02-17 09:24:59 +10:00
David Reid 4c7021e53d WASAPI: Fix an error when stopping a device. 2025-02-16 17:44:21 +10:00
David Reid 856494d253 Update docs for missing build options.
Public issue https://github.com/mackron/miniaudio/issues/942
2025-02-16 15:45:56 +10:00
David Reid a0aac6b5ec Remove reference to MA_HAS_OPUS. 2025-02-16 15:17:37 +10:00
David Reid 60c7c776b4 PulseAudio: Fix a possible race condition with device init. 2025-02-16 14:59:16 +10:00
David Reid 125e9226fb Fix an error with ma_sound processing. 2025-02-16 13:18:52 +10:00
David Reid 4deb3d4c6a Remove a stray space. 2025-02-16 13:17:52 +10:00
David Reid 3ffdbdc710 Add miniaudio.c.
This is in preparation for splitting miniaudio into a split .c/h pair,
away from a single header.

`MINIAUDIO_IMPLEMENTATION` is still supported, but will be removed in
version 0.12 and should be considered deprecated. It's recommended to
start the transition to the new .c file.
2025-02-16 10:30:00 +10:00
David Reid 9b9e71ab6c PulseAudio: Fix an error with the construction of the stream name. 2025-02-13 11:15:32 +10:00
znakeeye f39bbe2f4d Revert "Fix for NDK issue 360. dlclose() skipped pre-API 28. This fixes weird crashes during uninit."
This reverts commit 14f698fcf2.
2025-02-13 07:49:22 +10:00
znakeeye 79bb4d7a37 Improved fix for dlclose() bug on Android. Now applying fix for all backends on Android < 28. 2025-02-13 07:49:22 +10:00
znakeeye f970144a3d Fix for NDK issue 360. dlclose() skipped pre-API 28. This fixes weird crashes during uninit. 2025-02-13 07:49:22 +10:00
znakeeye afc7e17fe6 Added MA_NO_RUNTIME_LINKING support for AAudio backend. 2025-02-13 07:49:22 +10:00
znakeeye 047200eace Fixed double-free issue in AAudio backend. 2025-02-08 07:20:50 +10:00
HeroesOfBalkan 6d5efde254 Rename secondIndex variables to seekPointInSeconds 2025-01-22 09:24:38 +10:00
HeroesOfBalkan 9da8df1b9f Add explicit casts to suppress -Wfloat-conversion warnings 2025-01-22 09:24:38 +10:00
HeroesOfBalkan ed5964c9f6 Fix unused and unitialized variable warning 2025-01-22 09:24:38 +10:00
HeroesOfBalkan 7e81d3ac80 Refactor new methods to wrap around their PCM equivalents 2025-01-22 09:24:38 +10:00
HeroesOfBalkan 450dcb1af3 Fix bug returning success when NULL is passed & typo corrected in a comment 2025-01-22 09:24:38 +10:00
HeroesOfBalkan 38f7d29f6f New API methods to seek data sources using seconds 2025-01-22 09:24:38 +10:00
David Reid 1fe39f949a Fix a documentation error. 2025-01-21 13:04:24 +10:00
David Reid 3fb7027682 Update gitignore. 2025-01-18 14:30:00 +10:00
David Reid 14a455143f Version control some osaudio files. 2025-01-18 14:20:13 +10:00
David Reid 977bd616ff Add icons for website. 2025-01-18 14:19:44 +10:00
David Reid a3ae2e71ff Fix a typo. 2025-01-18 14:13:53 +10:00
David Reid 68a526a759 Update copyright date. 2025-01-18 10:48:35 +10:00
David Reid 8383893c9c Fix a bug in ma_data_source_read_pcm_frames_from_backend(). 2025-01-18 07:14:55 +10:00
David Reid 7a25af64d6 Fix a crash in ma_data_source_seek_pcm_frames(). 2025-01-17 19:11:26 +10:00
David Reid fc905ec97f Add simple_spatialization example. 2025-01-11 18:42:34 +10:00
David Reid 3081e314b7 Update change history. 2025-01-11 16:47:30 +10:00
David Reid fcddfe6204 Update ma_pcm_rb data source implementation.
The data source implementation of a ma_pcm_rb could possibly return a
frame count of 0 which would in turn result in
ma_data_source_read_pcm_frames() returning MA_AT_END which does not
make sense for a ring buffer since it has no notion of an end.
2025-01-11 16:30:15 +10:00
David Reid 547ef1c9b7 Don't return MA_AT_END from ring buffers.
There is no notion of an "end" in a ring buffer. Also, this result is
returned when the operation completed successfully which makes a result
code other than MA_SUCCESS confusing.
2025-01-11 15:57:42 +10:00
David Reid 928ed8bd85 Web Audio: Enable threading in ma_engine if compiling with -pthread.
With this commit, when targeting pthreads with the -pthread, the engine
will allow threading with it's internal resource manager.

Public issue https://github.com/mackron/miniaudio/issues/855
2025-01-11 13:00:33 +10:00
David Reid ae2cd4bea4 Web Audio: Add support for variable buffer sizes to Audio Worklets.
Support for this was added to Emscripten 3.1.70. Currently only
querying the quantum size is supported. I believe support for
configuring the quantum size is coming later in Web Audio 1.1.

Compilation with versions of Emscripten earlier than 3.1.70 is still
supported.
2025-01-11 10:17:20 +10:00
David Reid b53daca554 Clean up. 2025-01-11 09:25:43 +10:00
francois@recisio.com 1a7a9a7ed2 Fix build for emscripten before 3.1.70 2025-01-11 09:21:06 +10:00
francois@recisio.com 82ae0138f3 Improve fix, handle all outputs 2025-01-11 09:21:06 +10:00
francois@recisio.com 8d5bf8210c WebAudio: Fix a noise sound before device was started 2025-01-11 09:21:06 +10:00
David Reid ad615af1a8 Fix some warnings with GCC. 2025-01-11 08:47:29 +10:00
David Reid 3a34c049fa Merge branch 'dev' of https://github.com/mackron/miniaudio into dev 2025-01-10 13:02:37 +10:00
Dmitry Atamanov 970c3801d9 Small fixes in tools/audioconverter 2025-01-10 13:02:21 +10:00
David Reid da76932f6b Update change history. 2025-01-06 10:52:12 +10:00
strager 7dbb9f5e1a Fix missing ma_resampler_init argument in docs
ma_resampler_init has three parameters, not two. Add the missing
pAllocationCallbacks argument in the example code.
2025-01-06 09:04:07 +10:00
znakeeye bff9689b80 Moved null check to ma_close_stream__aaudio(). 2025-01-06 08:34:05 +10:00
David Reid bea73835dd A very minor change for style consistency. 2025-01-06 08:34:05 +10:00
David Reid 6e1b0dbce4 AAudio: Explicitly stop the device in the event of a reroute failure.
This commit removes the calls to ma_device__set_state() and replaces
them with a call to ma_device_stop() which is the intended way for
backends to change the state of the device. In addition, this comes
with the added effect of firing the stop callback when a reroute fails.
2025-01-06 08:34:05 +10:00
David Reid 08152a6a6d AAudio: Adjustments to a compatibility workaround.
This change makes it so that setBufferCapacityInFrames() and
setFramesPerDataCallback() can be opted-in if explicitly requested in
the device config.

This also adds back enableCompatibilityWorkarounds in order to prevent
anyone's build from breaking when updating. This will be removed again
in the 0.12 branch.
2025-01-06 08:34:05 +10:00
znakeeye b6747d5efc Fix rare crash during uninit where the streams got closed by worker thread (re-routing) and never re-opened. 2025-01-06 08:34:05 +10:00
znakeeye cbabd2d13a AAudio re-routing slightly improved. Retrying re-routing at most three times. If some BlueTooth device goes nuts and toggles connection state back and forth, we bail out. 2025-01-06 08:34:05 +10:00
znakeeye 546e23c0fb Fix an edge case where the newly re-routed stream gets disconnected and fails to start. Re-routing (again) solves this very rare error. 2025-01-06 08:34:05 +10:00