Commit Graph

3921 Commits

Author SHA1 Message Date
RainRat 3ba0595c6a fix typos 2024-04-11 12:40:39 +10:00
RainRat 4bc18bba5a revert unneeded changes per request 2024-04-11 12:40:39 +10:00
RainRat 26ce355703 fix typos 2024-04-11 12:40:39 +10:00
David Reid f7ad7772d1 ALSA: Try making the handling of poll() a bit more robust.
Public issue https://github.com/mackron/miniaudio/issues/836.
2024-04-07 14:38:09 +10:00
David Reid 0eb86ea1da Fix a bug where sounds loaded with MA_SOUND_FLAG_DECODE do not loop. 2024-03-01 09:59:44 +10:00
RainRat 2618c21415 revert unneeded changes per request 2024-03-01 08:35:45 +10:00
RainRat 030b9554c2 fix typos 2024-03-01 08:35:45 +10:00
David Reid c6d8b591f6 Remove some leftover experimental code. 2024-02-29 14:39:36 +10:00
David Reid 3bdf611768 Fix an invalid comment. 2024-02-29 14:30:48 +10:00
David Reid 63e1900db8 Update documentation. 2024-02-29 10:50:06 +10:00
David Reid 29da9b789c Add new init flags for sounds and resource managed data sources.
This adds the following flags:

  * MA_SOUND_FLAG_LOOPING
  * MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING

These can be used to initialize sounds and resource managed data
sources to loop by default. This is the recommended way to enable
looping for streams. The `isLooping` config option in
`ma_sound_config` and `ma_resource_manager_data_source_config` has been
deprecated. If you are using those, you should switch to the new flag
or else you'll get compiler errors when upgrading to a future version.
2024-02-29 10:25:02 +10:00
David Reid b454e7f14b PulseAudio: Try fixing a channel mapping bug.
Public issue https://github.com/mackron/miniaudio/issues/811
2024-02-28 18:40:35 +10:00
David Reid feea26496c Update Steam Audio example. 2024-02-28 17:17:13 +10:00
David Reid d36a2ef651 Minor cleanup. 2024-02-28 17:16:50 +10:00
David Reid e3af234720 Silence a warning in the node graph example. 2024-02-28 08:15:13 +10:00
David Reid 5cb0c05675 Update Steam Audio example to work with latest version. 2024-02-28 08:10:34 +10:00
David Reid 9aa6e035bb Memory improvements to node processing.
When processing a node, miniaudio will read into a temporary buffer
before mixing input attachments. This commit removes the per-node heap
allocation and replaces it with a per-graph stack. This should result
in less memory usage at larger scales, but at the expense of slightly
more usage at smaller scales.

The size of the stack can be configured via ma_node_graph_config. If
ma_engine is being used, it can be done via ma_engine_config.
2024-02-27 17:05:56 +10:00
David Reid 7a8ebd7f4d Update to node processing.
Previously, processing a node would involve a temporary buffer
allocated on the stack. Because this was fixed size, it would result in
processing being sub-divided into chunks in order to avoid overflowing
that buffer. This becomes an issue when a node needs to have a known
processing size. An example might be some kind of effect that requires
processing be in powers of two.

With this commit, the `processingSizeInFrames` variable in
`ma_node_graph_config` can be used to make it so processing always
happens in fixed sized chunks. In this situations, it's recommended you
always call `ma_node_graph_read_pcm_frames()` with a frame count of a
multiple of `processingSizeInFrames`.

The allocation strategy used here is not optimal and will be improved
in future commits. It currently allocates a buffer per-node, but since
the data contained within it is transient in nature, it should be
possible to use a global fixed sized stack that supports allocating a
variable amount of space within the stack buffer.
2024-02-27 15:31:17 +10:00
David Reid e32cc9ff83 Update dr_wav and dr_mp3. 2024-02-27 08:27:05 +10:00
David Reid babd7fb00f Forward declare ma_semaphore API. 2024-02-25 09:50:42 +10:00
David Reid f4e5cf99dc Update change history. 2024-02-08 15:26:55 +10:00
David Reid f20ab8a9ee Web: Increase the default stack size for the AudioWorklets thread. 2024-02-08 15:26:41 +10:00
Chris Genova aa57d052da Fix out of range check in ma_default_vfs_seek__win32 2024-01-30 10:54:46 +10:00
David Reid c0afa7e621 Web: Fix a possible JS error.
Public issue https://github.com/mackron/miniaudio/issues/810
2024-01-28 08:46:56 +10:00
David Reid bde517a166 Update dr_wav. 2024-01-23 16:34:34 +10:00
David Reid 3ed9d05c38 Fix compilation error on Android.
Public issue https://github.com/mackron/miniaudio/issues/805
2024-01-22 07:26:38 +10:00
David Reid a4aa0dc404 Fix amplification with ma_device_set_master_volume().
Public issue https://github.com/mackron/miniaudio/discussions/800
2024-01-12 08:10:53 +10:00
David Reid fd3c1b0af0 Formatting. 2024-01-10 18:19:24 +10:00
David Reid 10f9ef05a2 DirectSound: Attempted fix for an error when switching devices.
Public issue https://github.com/mackron/miniaudio/issues/779
2024-01-08 12:50:20 +10:00
David Reid bdab2fc3e0 Remove an accidental change to the deviceio test. 2024-01-08 12:30:04 +10:00
David Reid 9c73849f3b Fix a typo. 2023-12-23 09:30:08 +10:00
David Reid fde3a27d93 Add support for customizing pthread priorities at compile time.
Use the MA_PTHREAD_REALTTIME_THREAD_PRIORITY define.
2023-12-23 09:21:13 +10:00
David Reid 766a155fb3 Stop using MA_ASSERT in examples.
This is useful because MA_ASSERT is only defined in the implementation
section of miniaudio.h which can cause issues when people copy/paste
the code and use it in a file that does not have visibility of the
implementation.

Note that there are still more references to implementation-defined
macros, but these have been moved to the public section in the dev-0.12
branch so I'm not bothering to change those just yet.

Public issue https://github.com/mackron/miniaudio/issues/787
2023-12-17 08:42:19 +10:00
David Reid c29c001840 Fix an error where the pthread priority is not being set correctly. 2023-12-13 08:36:03 +10:00
David Reid ee3b7df66a Update change history. 2023-12-10 13:50:40 +10:00
David Reid 1325ac397b AAudio: Increase default min SDK version from 26 to 27.
Use `#define MA_AAUDIO_MIN_ANDROID_SDK_VERSION 26` if you need to
support SDK version 26.
2023-12-08 19:13:51 +10:00
xielock ed204e4b72 Fix bug in ma_node_detach_full(...) 2023-12-06 08:22:14 +10:00
David Reid 6099e6f41c Add support for customizing the min SDK version for AAudio.
Define MA_AAUDIO_MIN_ANDROID_SDK_VERSION to specify the minimum
required SDK version for enabling the AAudio backend.
2023-12-06 08:12:21 +10:00
David Reid 4f426f6db0 Update change history. 2023-12-06 07:59:52 +10:00
David Reid 7e38fa0e7e Update dr_wav. 2023-12-02 07:42:39 +10:00
David Reid d0709098cc Web: Try fixing a runtime error.
Public issue https://github.com/mackron/miniaudio/issues/781
2023-11-30 09:32:04 +10:00
David Reid 3c5b15b48b Update change history. 2023-11-29 07:51:30 +10:00
David Reid 2b8bb34ca2 Update split version for testing. 2023-11-29 07:31:38 +10:00
David Reid 2b0c525e53 Web Audio: Fix ScriptProcessNode path when compiling with --closure=1.
Audio Worklets do not work with --closure=1 because the callback used
with emscripten_create_wasm_audio_worklet_processor_async never gets
fired which means miniaudio will never be able to escape from it's busy
wait loop.

Public issue https://github.com/mackron/miniaudio/issues/778
2023-11-29 07:29:44 +10:00
David Reid 6cba159210 ALSA: Fix some warnings relating to unhandled return value of read(). 2023-11-29 06:27:03 +10:00
David Reid 1583329187 Update version. 2023-11-28 07:43:00 +10:00
David Reid 5a3655fea4 DirectSound: Add support for specifying an explicit HWND.
Public issue https://github.com/mackron/miniaudio/issues/779
2023-11-28 07:39:47 +10:00
David Reid 4a5b74bef0 Version 0.11.21 0.11.21 2023-11-15 11:23:00 +10:00
David Reid c77d40ba00 Core Audio: Fix a -Wshadow warning. 2023-11-15 10:35:34 +10:00
Michael Labbé 8fcf6889aa Add new ma_device_notification_type_unlocked notification
Unlocked notification fires on emscripten upon successful resume of
audio context attached to a device.  This occurs only once per device
and it happens after the browser has received the input event
necessary to begin playing audio on most webpages.  This is due
to autoplay rules.

It is recommended to wait until this event is fired to start a
'main game loop' on the web.
2023-11-15 10:28:02 +10:00