Commit Graph

2530 Commits

Author SHA1 Message Date
David Reid 2d3fdc526d Add ma_sound_get_data_source(). 2021-05-16 16:11:02 +10:00
David Reid ccd72f5714 Update example. 2021-05-16 16:10:52 +10:00
David Reid 2558bbbea4 Fix a crash when passing in a NULL engine config. 2021-05-16 16:05:08 +10:00
David Reid 46a033b43a Initial work on custom loop points and chaining for data sources.
This is locked behind the following compile time macro for now since
it'll involve breaking changes to custom data sources. This will be
removed in version 0.11:

  MA_EXPERIMENTAL__DATA_LOOPING_AND_CHAINING

Public issue https://github.com/mackron/miniaudio/issues/290
2021-05-16 15:36:20 +10:00
David Reid 2eb792b719 Fix some typos. 2021-05-14 17:54:21 +10:00
David Reid dba88558d1 Fix example code in documentation. 2021-05-10 21:20:42 +10:00
David Reid 2d11a3542c PulseAudio: Fix a bug with channel mapping. 2021-05-09 16:16:03 +10:00
David Reid c3636a45b9 PulseAudio: Try fixing a divide by zero error.
Public issue https://github.com/mackron/miniaudio/pull/308
2021-05-09 10:30:50 +10:00
David Reid 964e352e24 Fix a copy/paste error. 2021-05-03 16:28:09 +10:00
David Reid 8973469186 Simplify the data source config. 2021-05-03 16:07:19 +10:00
David Reid 11acb0caa5 Prep work in preparation for some changes to data sources.
Public issue https://github.com/mackron/miniaudio/issues/290
2021-05-03 15:35:07 +10:00
David Reid 1897c59993 Add support for initializing a sound from another.
This only works for non-streaming sounds whose data source was created
via the resource manager.
2021-05-03 12:08:24 +10:00
David Reid 236da866eb Silence some warnings when compiling with MA_DEBUG_OUTPUT. 2021-05-02 09:44:50 +10:00
David Reid 199d6a7875 Version 0.10.35 2021-04-27 17:31:19 +10:00
David Reid 3c80311743 Fix the C++ build. 2021-04-27 17:25:46 +10:00
David Reid 994cda44b5 Version 0.10.34 2021-04-26 16:32:00 +10:00
David Reid 16a605eebd Cleanup. 2021-04-26 16:28:57 +10:00
David Reid 24a8d433ac Clean up some debug output. 2021-04-26 16:22:02 +10:00
David Reid 50786617a8 ALSA: Add some debug output. 2021-04-26 13:15:13 +10:00
David Reid 8dc54984ec ALSA: Improvements to reading and writing logic.
Public issue https://github.com/mackron/miniaudio/issues/291
2021-04-26 12:36:25 +10:00
David Reid db53bdfc17 Fix a memory leak. 2021-04-26 12:07:54 +10:00
David Reid 403e9f7a74 ALSA: Fix a deadlock when stopping devices.
Public issue https://github.com/mackron/miniaudio/issues/291
2021-04-26 11:54:52 +10:00
David Reid 95bd7fb53b Update revision history. 2021-04-20 18:49:04 +10:00
David Reid 41b72f660c WASAPI: Attempt to fix a bug with loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/298
2021-04-20 17:43:36 +10:00
David Reid 7ecd1e5b40 Fix a bug when using default data formats in loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/298
2021-04-19 19:38:53 +10:00
David Reid 2f9f618434 Fix a bug in ma_encoder_init_file_w().
Public issue https://github.com/mackron/miniaudio/issues/297
2021-04-19 18:46:43 +10:00
David Reid f31bdb15fc Fix an error in some documentation. 2021-04-18 12:25:53 +10:00
David Reid 0a853ba30e Merge pull request #296 from chainblocks/master
Fix ubsan issue on macOS.

Public issue https://github.com/mackron/miniaudio/issues/295
2021-04-18 11:53:11 +10:00
Giovanni Petrantoni b00175209d Merge branch 'dev' of git://github.com/mackron/miniaudio 2021-04-18 09:12:51 +09:00
Giovanni Petrantoni 1c09a5d7b8 Merge branch 'master' of git://github.com/mackron/miniaudio 2021-04-18 09:05:28 +09:00
Giovanni Petrantoni 32d28747a8 Attempt to fix ubsan issue under macOS #295 2021-04-18 08:56:54 +09:00
David Reid 2f56829b45 Fix an error due to inconsistent types. 2021-04-09 17:52:53 +10:00
David Reid a7e9b5dd5e Update revision history. 2021-04-08 09:11:51 +10:00
David Reid 821c057daa WASAPI: Fix a bug where a result code is not getting checked.
This was not propagating the result code when retrieving the render or
capture client from an audio client.
2021-04-08 09:08:58 +10:00
David Reid 56beafcfe9 Fix a possible crash in the engine when loading async sounds.
This crash can happen if the decoder reads more data than it reports
from ma_decoder_get_length_in_pcm_frames().
2021-04-06 20:45:54 +10:00
David Reid 56a5ecbdbd Fix a subtle bug in gain smoothing. 2021-04-05 19:34:11 +10:00
David Reid c300aa9f72 Experimental fix for an issue with gain smoothing. 2021-04-05 19:19:08 +10:00
David Reid 1604512e89 Make spatialization gain smoothing configurable at the engine level. 2021-04-05 18:16:08 +10:00
David Reid 9097bb862b Minor tweak to default gain smoothing time for spatialization. 2021-04-05 17:58:26 +10:00
David Reid 602161b69b Fix a crackling bug with spatialization.
This crackling was happening due to abrupt volume transitions as the
gain changes for each channel as sounds move around the world. This
change smooths out these transitions using linear interpolation.
2021-04-05 16:07:09 +10:00
David Reid 608e839c6a Fix a warning. 2021-04-05 13:21:02 +10:00
David Reid f28d61e493 Mark devices as default on the null backend. 2021-04-05 13:09:31 +10:00
David Reid 8a1c72f2c3 Fix a pitching bug with the engine.
This is happening when the engine's sample rate differs from the data
source's sample rate.
2021-04-05 12:37:22 +10:00
David Reid 2a31247b50 Fix a bug when async loading sounds with an unknown length. 2021-04-05 10:54:10 +10:00
David Reid 8c2f457de9 Reduce the weight of ma_sound by allocating some data on the heap. 2021-04-04 18:38:12 +10:00
David Reid 65987d8034 Unify the ma_sound and ma_sound_group APIs. 2021-04-04 16:18:56 +10:00
David Reid e968fb38ae Fix some bugs for sounds not backed by a data source. 2021-04-04 14:52:08 +10:00
David Reid dba9e1b314 Add support for more advanced sound configuration.
* Sounds can now have another node be used as input rather than a
    data source.

  * Sounds can now have a configurable input and output channel count.
    For sounds that are backed by a data source, the input channel
    count will always be set to the data source's native channel count.

  * Sounds can now be initially attached to any node and input bus
    rather than only a sound group.

With this change, sounds can now be used as groups. In future commits,
it's likely that ma_sound_group will be unified with ma_sound. Whether
or not the `ma_sound_group_*()` APIs will continue to exists is for now
undecided.

This change allows more flexibility for doing custom effects before the
spatialization stage in the DSP pipeline. The problem with the existing
design is that there's no way to apply a custom effect before
spatialization which becomes a problem because spatialization will
often increase the channel count which results in excessive effect
processing due to the increased channel count. Now it should be
possible to set up a graph such that an effect can be plugged in
between the data source and the spatializer.

A new function called `ma_sound_init_ex()` has been added which is what
needs to be used to initialize a sound without a data source. This API
uses the config/init pattern. The config is called `ma_sound_config`.
2021-04-04 12:05:36 +10:00
David Reid fca829edef Version 0.10.33 2021-04-04 08:04:50 +10:00
David Reid f814a10c02 Try fixing a bug with doppler effect and rotations. 2021-04-02 13:50:16 +10:00