Commit Graph

4184 Commits

Author SHA1 Message Date
David Reid 26c11a7771 Process jobs on the calling thread when WAIT_INIT is used.
Since the calling thread is waiting anyway, it's better to just do the
processing on the calling thread rather than posting it to the job
queue and waiting. This ensures the calling thread stays busy which
will improve performance, but it also makes it so the calling thread
doesn't get stalled while already-queued jobs are getting processed.
2023-05-12 09:11:29 +10:00
David Reid 870ac8a22c Don't link to advapi32.dll for the GDK build. 2023-05-06 08:59:13 +10:00
David Reid a1ea4438ee Fix ma_dlopen() on the GDK build. 2023-05-06 08:50:55 +10:00
David Reid 902c19d6ab WASAPI: Another fix for the GDK build. 2023-05-06 08:41:08 +10:00
David Reid 64f14070a7 WASAPI: Revert an experimental change and try fixing GDK build. 2023-05-06 08:31:32 +10:00
David Reid 6d20ccb701 WASAPI: Experimental change for rerouting. 2023-05-05 10:26:39 +10:00
David Reid 96ac03f184 WASAPI: Log error codes when a device fails to start. 2023-05-05 09:34:31 +10:00
David Reid e913a6d1aa Silence a warning. 2023-05-05 09:24:46 +10:00
David Reid de706d44b8 Experimental fix for better handling of AUDCLNT_E_DEVICE_INVALIDATED. 2023-05-05 09:18:18 +10:00
David Reid 2bf7e03777 WASAPI: Relax validation checks when doing device reroutes. 2023-05-05 08:55:23 +10:00
David Reid ae25dbcdac Fix a memory leak in ma_sound_init_copy().
Public issue https://github.com/mackron/miniaudio/issues/667
2023-05-03 08:02:42 +10:00
David Reid 4326fad97a Update links in readme. 2023-04-30 12:15:38 +10:00
David Reid 937cd9c16c Another update to the readme to make it less wordy. 2023-04-30 12:03:26 +10:00
David Reid d1f3715a08 Playing around with a restructure to the readme. 2023-04-30 11:20:53 +10:00
David Reid 9fe0970e20 Remove the previous experimental change to the readme. Doesn't work. 2023-04-30 08:56:43 +10:00
David Reid a74c2c78d9 Try fixing some HTML formatting. 2023-04-30 08:54:26 +10:00
David Reid 189beb67fa Experiment with a change to the readme. 2023-04-30 08:53:14 +10:00
David Reid 7384bde372 Update change history. 2023-04-30 08:39:53 +10:00
David Reid 26b0a9ffc0 Version 0.11.15 0.11.15 2023-04-30 08:32:13 +10:00
David Reid d3e1ba4440 Remove Twitter badge from readme. 2023-04-30 08:21:23 +10:00
David Reid 1ac2abc36e Update c89atomic. 2023-04-28 09:39:59 +10:00
David Reid 97663b349d WASAPI: Work on process loopback support.
This is still not working on my machine. The device will initialize and
run, but the captured data is always silent for some reason. I have
been unable to figure out how to make this work.

This commit allows initialization of the device to complete at the very
least.

Public issue https://github.com/mackron/miniaudio/issues/484
2023-04-25 18:29:36 +10:00
David Reid 5541983ff0 WASAPI: Make format retrieval more robust.
Public issue https://github.com/mackron/miniaudio/issues/660
2023-04-24 18:56:13 +10:00
David Reid e386435af9 WASAPI: Fix a possible memory access bug.
The issue here is that it's possible for miniaudio to attempt to access
data from a WAVEFORMATEXTENSIBLE structure when the object is actually
only a WAVEFORMATEX structure which is smaller which can therefore
result in trying to access unallocated memory.

Public issue https://github.com/mackron/miniaudio/issues/660
2023-04-20 08:23:02 +10:00
David Reid 0d78b28f56 Update change history. 2023-04-19 08:35:07 +10:00
David Reid 12fa73db2a Fix an error when initializing a duplex device on some backends.
Public issue https://github.com/mackron/miniaudio/issues/659
2023-04-19 08:16:33 +10:00
David Reid 6cddea6fe3 Remove Twitter shield. 2023-04-12 07:56:03 +10:00
David Reid 83c221f83e Merge branch 'dev' into dev-0.12 2023-04-08 09:29:54 +10:00
David Reid f068a7934c Have ma_sound_init_copy() inherit volume smoothing settings. 2023-04-08 09:28:58 +10:00
David Reid 713093d67d Add support for setting the default volume smooth time for sounds.
This is set via the engine config.
2023-04-08 09:26:57 +10:00
David Reid f59a2c4cba Merge branch 'dev' into dev-0.12 2023-04-07 18:09:56 +10:00
David Reid 3769393b85 Update change history. 2023-04-07 18:09:38 +10:00
David Reid cc2076055f Merge branch 'dev' into dev-0.12 2023-04-07 17:41:09 +10:00
David Reid 23345b47e8 Add support for volume smoothing to sounds.
Smoothing is disabled by default. To enable it, you must use
ma_sound_init_ex() and configure it via the volumeSmoothTimeInPCMFrames
member of ma_sound_config.

This commit also fixes a bug where ma_gainer is not properly applying
smoothing.
2023-04-07 17:34:33 +10:00
David Reid 58166e2267 API CHANGE: Updates to custom backends.
Custom backends must now use the `ma_device_backend_vtable` object to
define their callbacks. All of these functions are largely the same,
except they all now take a `void*` as their first parameter which
represents the user data pointer.

The ma_backend_callbacks parameter has been removed from onContextInit
which means you must now statically define your callbacks in the
ma_device_backend_vtable object that you pass into the context config.

The `custom` member of the context config has been replaced with a new
set of members to support the ability to plug in multiple vtables.
2023-04-01 12:06:52 +10:00
David Reid 68c8b8000e More scaffolding in preparation for the new backend vtable system.
With this commit, the device IO code is now using the new vtable
system, but each of the stock backends are still using the old
callbacks internally. There exists a compatibility wrapper vtable
which all stock backends are currently using. As stock backends migrate
over to the new system, the compatiblity vtable will be replaced with
the backend-specific vtable.
2023-04-01 10:47:38 +10:00
David Reid 35403d4b9c Set up some scaffolding for the new backend vtable system.
The new system is in preparation for improving the custom backend
system and making it more modular. The old system does not support
user data which make things a bit less flexible than it should be. In
addition, the old system does not make it easy to plug in multiple
custom backends.

The changes in this commit, and probably the next few, are just
scaffolding so that we don't have to break the build of every platform
as this is worked on.
2023-04-01 10:02:17 +10:00
David Reid fbb0f9dd72 Add support for a processing callbacks for sounds. 2023-04-01 08:51:20 +10:00
David Reid 203de65568 Add support for setting a callback for when a sound finishes loading. 2023-03-31 12:30:27 +10:00
David Reid 48b2986114 API CHANGE: Changes to the sound notification system.
* The pDoneFence parameter has been removed from ma_sound_init_*()
  and replaced with pNotifications which is of the type
  ma_sound_notifications. This object is where the pDoneFence is
  now located.
* ma_sound_set_end_callback() has been removed. The callback is now
  specified in the pNotifications object.
* The endCallback and pEndCallbackUserData members of ma_sound_config
  have been removed. You must now specify this in pNotifications.
2023-03-31 11:54:14 +10:00
David Reid ef5861acdb API CHANGE: Remove pDoneFence from ma_sound_config.
Use initNotifications instead.
2023-03-30 09:54:31 +10:00
David Reid 2bdad08247 API CHANGE: Remove the idea of a ma_node_graph being a node.
A node graph should not be considered a node because a node needs to
be owned by a node graph which means a node graph being a node would
create a cyclic dependency.
2023-03-30 09:09:56 +10:00
David Reid 5da18c3ca8 API CHANGE: Remove playback.name and capture.name from ma_device.
Use ma_device_get_name() instead.
2023-03-30 08:53:52 +10:00
David Reid 529e70c653 API CHANGE: Remove the onStop callback from ma_device.
Use onNotification instead.
2023-03-30 08:44:25 +10:00
David Reid ec1364d3a1 API CHANGE: Remove all ma_resource_manager_job* APIs.
Use `ma_job` instead. Anything that was previously named as
`ma_resource_manager_job*` is now named `ma_job*`.
2023-03-30 08:40:27 +10:00
David Reid 9c69d50468 API CHANGE: Update ma_audio_buffer_config_init() to take a sample rate. 2023-03-30 08:36:19 +10:00
David Reid 35a0c7b465 API CHANGE: Update ma_audio_buffer_ref_init() to accept a sample rate. 2023-03-30 08:33:56 +10:00
David Reid 8042a37822 API CHANGE: Update ma_sound_config_init().
This adds a `ma_engine*` parameter to the following functions:

  * ma_sound_config_init()
  * ma_sound_group_config_init()

The following functions have been removed (use the above functions
instead):

  * ma_sound_config_init_2()
  * ma_sound_group_config_init_2()
2023-03-30 08:31:27 +10:00
David Reid ac09b507ef API CHANGE: Remove the "wet" and "dry" parameters from the delay effect
The "dry" parameter was equivalent to pre-multiplying the input, and
the "wet" parameter was equivalent to multiplying the output. Do this
if you are needing to replicate the old functionality.

Public issue https://github.com/mackron/miniaudio/issues/548
2023-03-30 08:24:17 +10:00
David Reid 30c4b7130f API CHANGE: Remove ma_noise_set_type().
To change the noise type you need to create a new ma_noise object.
2023-03-30 08:14:09 +10:00