Commit Graph

4120 Commits

Author SHA1 Message Date
David Reid a81f09d93c Add osaudio to the extras folder.
This is just a small project to experiment with a few API ideas. This
is not a replacement for miniaudio or anything so don't panic.
2023-08-17 19:45:15 +10:00
David Reid f2ea656297 Correctly mark some functions as static. 2023-08-17 19:32:06 +10:00
David Reid ed68fda5d0 Fix some errors with the SDL backend. 2023-08-17 19:29:27 +10:00
David Reid 7e01c6535b More work on custom device backends.
With this commit, custom backends can now be implemented as
self-contained modules that can easily be plugged in and mixed and
matched depending on a programs requirements. The order in which
custom backends are specified in the context config determine their
priority.

This commit updates the custom_backend example by moving the SDL
code out into its own file in "extras/backends/sdl". The example will
now just include the SDL code files like normal. This represents a more
realistic scenario.
2023-08-07 16:14:05 +10:00
David Reid 60366fe469 Make some code public to ease development of custom backends. 2023-08-07 13:55:37 +10:00
David Reid 5b32ce15d1 Merge branch 'dev' into dev-0.12 2023-08-07 12:13:48 +10:00
David Reid c24141c5ae Remove the use of some deprecated functions. 2023-08-07 12:13:36 +10:00
David Reid 7266a1a6da Merge branch 'master' into dev-0.12 2023-08-07 11:06:21 +10:00
David Reid 3898fff8ed Version 0.11.18 0.11.18 2023-08-07 11:05:14 +10:00
David Reid 9eca9ce0cd Update dr_libs. 2023-08-07 10:00:49 +10:00
David Reid d4fd8411c4 Update Emscripten test. 2023-08-06 15:39:54 +10:00
David Reid efa9e7d727 Web Audio: Memory usage optimization to the Audio Worklet path.
This applies only to duplex devices.
2023-08-06 15:31:50 +10:00
David Reid c24829cbb9 Web Audio: Refactoring to the ScriptProcessorNode path.
This unifies, as much as possible, the ScriptProcessorNode path with
the AudioWorklets path to avoid some code duplication, and to also make
the two paths more similar to each other to ease in maintenance.
2023-08-06 15:06:37 +10:00
David Reid fde7d20414 More improvements to the AudioWorklets Web Audio backend.
* Duplex mode now only creates a single AudioContext and AudioWorklet
  * Devices should now automatically start in response to a gesture
2023-08-06 10:42:48 +10:00
David Reid c36b391cc5 Update changes. 2023-08-05 17:58:01 +10:00
David Reid 4d23c1c5ab Update build instructions for Emscripten. 2023-08-05 17:53:58 +10:00
David Reid 810cdc2380 Improvements to Audio Worklets support for Web Audio.
Public issue https://github.com/mackron/miniaudio/issues/597
2023-08-05 17:02:26 +10:00
David Reid 53907863c7 Add support for stopping and sound and fading out.
This adds the following APIs:

  * ma_sound_stop_with_fade_in_pcm_frames()
  * ma_sound_stop_with_fade_in_milliseconds()
  * ma_sound_set_stop_time_with_fade_in_pcm_frames()
  * ma_sound_set_stop_time_with_fade_in_milliseconds()

These functions will overwrite any existing fades. For the
set_stop_time variants, you specify the time that the sound will be put
into it's stopped state. The fade will start at stopTime - fadeLength.
If the fade length is greater than the stop time, the fade length will
be clamped.

Public issue https://github.com/mackron/miniaudio/issues/669
2023-08-05 10:04:59 +10:00
David Reid f9f542b2fb Fix a fading bug introduced with an earlier commit. 2023-08-05 09:19:17 +10:00
David Reid e43457fcce Add initial implementation for scheduled fades.
This adds the following APIs:

  * ma_sound_set_fade_start_in_pcm_frames()
  * ma_sound_set_fade_start_in_milliseconds()

Public issue https://github.com/mackron/miniaudio/issues/669
2023-08-04 20:28:56 +10:00
David Reid 356eb3252e Set up some infrastructure for starting fades with an offset. 2023-08-04 19:26:55 +10:00
David Reid 3429769623 Update change history. 2023-08-04 12:14:18 +10:00
David Reid f2fc207462 Merge branch 'dev' into dev-0.12 2023-08-04 10:47:09 +10:00
David Reid ca7284fde5 ALSA: Fix an error where restarting a device can fail. 2023-08-03 17:03:33 +10:00
David Reid 2212965267 Fix errors with the C89 build. 2023-08-03 09:16:59 +10:00
David Reid 320245606a Fix C89 build. 2023-08-02 19:41:06 +10:00
David Reid 18e4756be3 Decouple MA_API and MA_STATIC defines. 2023-08-02 08:39:56 +10:00
David Reid 8df02809b5 Remove stale comment. 2023-07-30 08:19:03 +10:00
Taiko2k 1696031633 Tweak pulseaudio stream flags 2023-07-30 08:17:21 +10:00
David Reid 90bdda29ae Fix a typo. 2023-07-30 08:14:38 +10:00
David Reid ba1b349a5a Merge branch 'dev' into dev-0.12 2023-07-22 16:39:45 +10:00
David Reid 69bc820ae8 Fix an error when loading WAV files.
The sample format of a WAV file is not always being set which results
in get_data_format() returning ma_format_unknown.
2023-07-22 16:39:17 +10:00
David Reid 052d8bd857 Merge branch 'dev' into dev-0.12 2023-07-22 16:22:25 +10:00
David Reid 98a39ded77 Fix compilation error with previous commit. 2023-07-21 18:19:49 +10:00
David Reid 4c7e3218e3 Improvements to decoder initialization.
This change makes use of the onInitFile, onInitFileW and onInitMemory
backend callbacks which enables decoding backends to have optimized
implementations for reading from a file or a block of memory without
having to go through an abstraction layer on the miniaudio side.

Public issue https://github.com/mackron/miniaudio/issues/696
2023-07-21 18:18:15 +10:00
David Reid b2ed26cf76 Fix an error with setting of the cursor when seeking a Vorbis file.
Public issue https://github.com/mackron/miniaudio/issues/707
2023-07-21 07:39:07 +10:00
David Reid 7f0a92a08f Don't call CoUninialize() when CoInitializeEx() fails. 2023-07-09 09:49:01 +10:00
David Reid ab87375257 Add ma_engine_get_volume().
Public issue https://github.com/mackron/miniaudio/issues/700
2023-07-08 09:18:41 +10:00
David Reid 0eadb0f30e Make ma_linear_resampler_set_rate_ratio() more accurate. 2023-07-07 16:47:24 +10:00
David Reid 6117016102 Fix some minor linting warnings. 2023-06-17 08:15:02 +10:00
David Reid dcd432bc84 Update data converter to use the default LPF order for resampling.
This ensures the data converter has the same defaults as the resampler
so things work a bit more consistently.
2023-06-17 08:11:10 +10:00
David Reid 22724a9156 Merge branch 'dev' into dev-0.12 2023-06-17 08:06:45 +10:00
David Reid a6eb7d6a6f Update change history. 2023-06-17 08:06:22 +10:00
Jay Baird e9ba163490 Fix issue where duty cycle of a pulsewave was not correctly set at init time 2023-06-10 08:42:27 +10:00
David Reid f9076ef327 Update dr_wav with more AIFF improvements. 2023-06-08 09:10:07 +10:00
David Reid eabc776898 Fix erroneous output with the resampler when in/out rates are the same. 2023-06-08 08:34:04 +10:00
David Reid 4c49c49596 Update change history. 2023-06-07 21:14:58 +10:00
David Reid 34b40bdc17 Update dr_wav with improved AIFF compatibility. 2023-06-07 13:58:46 +10:00
David Reid d30b3a76a5 Merge branch 'dev' into dev-0.12 2023-06-05 16:06:03 +10:00
David Reid e1bfeb212a AAudio: Reverse some incorrect logic when setting up streams. 2023-06-05 15:44:27 +10:00