Commit Graph

1955 Commits

Author SHA1 Message Date
David Reid 6e017f7fe7 Add some APIs for ma_audio_buffer and ma_decoder.
* ma_audio_buffer_get_available_frames()
  * ma_decoder_get_available_frames()
2020-08-08 12:14:18 +10:00
David Reid 61b545e2b4 Resource Manager: Rename some APIs for consistency. 2020-08-03 20:32:50 +10:00
David Reid dbbae5b6a6 Resource Manager: Remove some unnecessary functions. 2020-08-03 19:43:29 +10:00
David Reid 91d1a5abcd Resource Manager: Add public APIs for data stream/buffer/source. 2020-08-03 19:37:16 +10:00
David Reid d48708d5de Big refactor to the resource manager.
* The data buffers and data streams are now first class data sources.
  * The ma_resource_manager_data_source object is now just a simple
    wrapper around ma_resource_manager_data_buffer and
    ma_resource_manager_data_stream.
  * Unnecessary pResourceManager parameters have been removed.
  * The part of the data buffer that's added to the BST has been split
    out from the main data buffer object so that the main object can be
    owned by the caller.
  * Add ma_resource_manager_data_source_get_available_frames() which is
    used to retrieve the number of frames that can be read at the time
    of calling. This is useful in asynchronous scenarios.
2020-08-02 21:26:34 +10:00
David Reid 5303558ac8 Add ma_resource_manager_data_source_get_available_frames(). 2020-08-02 13:58:36 +10:00
David Reid 0336896c33 Resource Manager: Update some documentation for implementation details. 2020-08-02 12:38:14 +10:00
David Reid 6425fc643a Update dr_wav, dr_flac and dr_mp3. 2020-08-02 11:53:41 +10:00
David Reid 4830c9f5b5 Update c89atomic. 2020-08-02 11:53:00 +10:00
David Reid d0149a0374 Simplify sized types. 2020-08-02 09:15:40 +10:00
David Reid b48d0dfbdd WASAPI: A few tweaks for handling device changes. 2020-08-02 08:41:19 +10:00
David Reid f947a75dbe Silence a warning on VC6. 2020-08-01 12:03:02 +10:00
David Reid 5b50d07fe8 Update c89atomic. 2020-08-01 11:59:02 +10:00
David Reid f6a4e33946 Clean up some code from an earlier commit. 2020-08-01 11:43:35 +10:00
David Reid 54fe965bc0 Fix some bugs in ma_data_source_read_pcm_frames()
* A crash when the pFramesRead parameter is null
  * Looping not working due to MA_AT_END now being returned.

Public issue https://github.com/dr-soft/miniaudio/issues/185
2020-08-01 11:39:58 +10:00
David Reid 0a9f0c625c WASAPI: Try fixing a deadlock when disabling a device.
Public issue https://github.com/dr-soft/miniaudio/issues/184
2020-08-01 10:51:03 +10:00
David Reid 11e488e1cc Win32: Use better error detection for WaitForSingleObject(). 2020-08-01 08:21:05 +10:00
David Reid 1aac650c46 Core Audio: Fix build errors on macOS. 2020-07-30 17:30:52 +10:00
David Reid 63aef51bfc Fix a typo. 2020-07-29 19:24:10 +10:00
David Reid 7d055a44e5 Update revision history. 2020-07-29 18:30:50 +10:00
David Reid cb542d29f5 OpenSL: Fix a multithreading bug in context init/uninit.
This should fix the case where multiple context's are initialized and
uninitialized at the same time across multiple threads.
2020-07-29 18:28:40 +10:00
David Reid d2582f260e OpenSL: Use runtime linking for libOpenSLES.
Public issues:

  * https://github.com/dr-soft/miniaudio/issues/163
  * https://github.com/dr-soft/miniaudio/issues/183
2020-07-29 18:18:05 +10:00
David Reid 3e0ad8dd42 Reword a comment. 2020-07-27 18:08:56 +10:00
David Reid 0d8bf45dba Start some documentation for resource management. 2020-07-26 15:41:33 +10:00
David Reid 4fef753432 Resource Manager: Add public APIs for reading and seeking. 2020-07-25 19:49:20 +10:00
David Reid 5eb7761d8e Resource Manager: Rename some APIs for consistency. 2020-07-25 19:19:52 +10:00
David Reid 2a15044ff9 Update resource_manager example. 2020-07-25 18:27:59 +10:00
David Reid 3df4a9e860 Resource Manager: Decode synchronously on the calling thread.
This commit changes synchronous decoding so that the calling thread is
the one which performs the decoding. Previously, decoding was done on
the job threads which was then waited on by an event on the calling
thread. The rationale for this design was to keep decoding on a single
code path, however this creates a problem for programs that would
prefer not to have any asynchronous job threads. In this case, these
synchronously decoded sounds would never get decoded because there
would not be any threads available to actually perform the decoding.

This commit enables the resource manager to be able to be used without
a job thread so long as asynchronous decoding and streaming are not
used. This scenario could be useful for programs that want to pre-load
all of their sounds at load time and save some system resources by not
incurring the overhead of an additional unnecessary thread.
2020-07-25 18:06:48 +10:00
David Reid 7d8f054a73 Documentation fix. 2020-07-25 16:18:54 +10:00
David Reid 380a9fbf09 Punctuation. 2020-07-25 16:16:57 +10:00
David Reid 6438162119 Documentation fix. 2020-07-25 16:03:08 +10:00
David Reid b067926d6d Update FLAC, MP3 and WAV decoders. 2020-07-25 15:42:50 +10:00
David Reid 4f78581a92 Update wording in simple_duplex example. 2020-07-25 15:42:25 +10:00
David Reid 4ae9c891b1 Update order of links in readme. 2020-07-25 15:07:34 +10:00
David Reid 854c824d7e Update revision history. 2020-07-25 15:03:54 +10:00
David Reid 7ca0e6a1bb Merge branch 'dev' of https://github.com/dr-soft/miniaudio into dev 2020-07-25 15:03:14 +10:00
David Reid 6455d9ddc8 Update readme. 2020-07-25 15:02:58 +10:00
David Reid 917dc594e4 Core Audio: Improvements to device enumeration on iOS. 2020-07-25 14:31:33 +10:00
David Reid 21043fd62d Fix a compilation warning. 2020-07-25 12:51:17 +10:00
David Reid b1894532af Rewording to documentation. 2020-07-25 11:48:55 +10:00
David Reid 5bb15a8edc Update dr_mp3. 2020-07-23 18:57:53 +10:00
David Reid e6fb975c05 Update CONTRIBUTING. 2020-07-23 18:56:37 +10:00
David Reid a0f98cc7a5 Merge branch 'master' into dev 2020-07-23 17:50:01 +10:00
David Reid 5c985bd7f1 Stop version controlling some auto-generated website files. 2020-07-23 17:47:10 +10:00
David Reid 24a1108834 Minor updates to the resource_manager example. 2020-07-23 17:01:04 +10:00
David Reid 83178a1dfc Fix a buffer overflow in the mixer. 2020-07-23 09:44:20 +10:00
David Reid 5dda38d417 Add a clarifying comment to the resource_manager example. 2020-07-23 08:02:19 +10:00
David Reid 8800c3e763 Add miniaudio-rs as an unofficial binding. 2020-07-23 07:41:22 +10:00
David Reid 9972488bde Add some comments to the resource manager example for clarity. 2020-07-22 20:50:57 +10:00
David Reid 3bcdf3942d Add a resource manager example. 2020-07-22 20:35:34 +10:00