Commit Graph

3487 Commits

Author SHA1 Message Date
David Reid 40a85d18f6 Fix logging of device info for loopback devices. 2022-09-17 17:51:21 +10:00
David Reid 394d31577f Another attempted fix for process loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/484
2022-09-10 09:41:53 +10:00
David Reid 24950dc14f Fix the C++ build. 2022-09-10 09:02:45 +10:00
David Reid b8bb19eb08 Minor platform detection fix for ma_dlopen(). 2022-09-09 16:45:25 +10:00
David Reid 44ea01c0ab Add runtime linking for mmdevapi and ActivateAudioInterfaceAsync() 2022-09-09 15:18:50 +10:00
David Reid 3638d5a835 Add MA_FORCE_UWP to force the UWP build. 2022-09-09 14:31:57 +10:00
David Reid dc5d99462d Fix some errors and warnings with the UWP build. 2022-09-09 14:17:23 +10:00
David Reid ceaa0df09b WASAPI: Fix an error with device reinitialization and loopback mode. 2022-09-09 10:49:15 +10:00
David Reid c299c0f113 Add a clarifying comment. 2022-09-09 10:46:45 +10:00
David Reid 193abde820 WASAPI: Add some logging for loopback mode. 2022-09-09 10:44:50 +10:00
David Reid 543a7ed991 WASAPI: Use the correct virtual device for process-specific loopback.
Public issue https://github.com/mackron/miniaudio/issues/484
2022-09-09 10:07:09 +10:00
David Reid b215b8e473 WASAPI: Mark some loopback related config properties as experimental. 2022-09-09 08:07:18 +10:00
David Reid 05066e7163 WASAPI: Add support for process-specific loopback capture.
Public issue https://github.com/mackron/miniaudio/issues/484
2022-09-08 11:39:55 +10:00
David Reid 79179703e4 WASAPI: Try fixing an issue with loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/533
2022-09-06 14:42:32 +10:00
David Reid ddbc5768a6 ALSA: Fix a potential crash on older versions of Linux.
Public issue https://github.com/mackron/miniaudio/issues/532
2022-09-04 08:28:03 +10:00
Fabio Arnold b8b3affa1b webaudio: Count references to window.miniaudio 2022-09-03 17:12:23 +10:00
Fabio Arnold f466414fd2 webaudio: Remove miniaudio from window on uninit 2022-09-03 17:12:23 +10:00
Jan Polák be32dc0e04 Fix UB when there are no audio devices
When there are no capture nor playback devices, pContext->pDeviceInfos
is NULL and pContext->playbackDeviceInfoCount is 0.
Unfortunately, any arithmetic on NULL is UB, including trivial +0,
which triggers UB sanitizer. This can lead to crashes,
for example when compiling with Zig, which enables UBsan by default.
2022-09-03 08:35:40 +10:00
David Reid 0c92dac883 Experiment with some sectioning for ease of navigation and tooling. 2022-09-02 11:02:47 +10:00
David Reid ef737641de PulseAudio: Add a null pointer check for safety.
Public issue https://github.com/mackron/miniaudio/issues/527
2022-08-29 09:57:35 +10:00
David Reid 93e1755e37 Add support for more than 2 outputs to splitter nodes. 2022-08-29 07:34:34 +10:00
David Reid cf15442818 Fix a typo. 2022-08-25 09:47:58 +10:00
David Reid 7fd70cf511 Remove a redundant sentence in the documentation. 2022-08-25 09:46:55 +10:00
David Reid b39fc571e7 Remove unnecessary cast. 2022-08-24 09:55:43 +10:00
Manuel Graf 5a5f4f0706 Fix low level API code example in README 2022-08-24 09:55:03 +10:00
David Reid 3d4ab9d9f0 iOS: Try to improve the default session category. 2022-08-20 09:33:42 +10:00
David Reid 334ed4fee6 iOS: Stop forcing AVAudioSessionCategoryOptionDefaultToSpeaker.
This is being forced when ma_ios_session_category_default is specified.
2022-08-18 11:13:31 +10:00
David Reid 8f7943d828 Have PulseAudio use the requested sample rate when initializing device. 2022-08-16 14:31:05 +10:00
David Reid deb0e53a15 Try fixing a bug where it's possible for old audio data to be output.
Public issue https://github.com/mackron/miniaudio/issues/506
2022-08-11 17:05:07 +10:00
David Reid a549754b37 Fix SDK version detection for the Android build and AAudio. 2022-08-11 17:03:32 +10:00
David Reid 14817aeb9d WASAPI: Fix a bug where the device is not drained when stopped. 2022-08-11 14:50:37 +10:00
David Reid 18601c0831 Properly set the mono expansion mode on the engine node. 2022-08-11 12:07:55 +10:00
David Reid 8e73283255 Fix default mono expansion mode for sounds. 2022-08-11 11:47:12 +10:00
David Reid 296f3f55dd Add support for per-sound mono expansion modes. 2022-08-11 11:43:35 +10:00
David Reid 26e429ff3b Fix a possible crash when initializing a channel converter. 2022-08-11 10:28:51 +10:00
David Reid d2153bc8e8 Remove an unnecessary function declaration. 2022-08-11 10:05:14 +10:00
David Reid c9fc9f5548 Formatting. 2022-08-11 09:56:31 +10:00
Steven Noonan 1022e1c08f wasapi: implement support for avrt.dll thread characteristics API
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2022-08-11 09:54:35 +10:00
David Reid 721863605e Minor style change. 2022-08-11 09:53:29 +10:00
Steven Noonan 5aee5d656a channel mapping: treat "simple" mix mode as a 1:1 mapping only mode
We already map the in:out 1:1 mappings above the switch statement, but
the code for "simple" mapping stomps on the mappings.

Also, even before that loop was added, mix mode "simple" did not
necessarily map to the same channel types you'd expect. For example, if
you have a 6-channel input and 8-channel output, you would get something
like this with "simple":

  Correct:  CHANNEL_FRONT_LEFT -> CHANNEL_FRONT_LEFT
  Correct:  CHANNEL_FRONT_RIGHT -> CHANNEL_FRONT_RIGHT
  Correct:  CHANNEL_FRONT_CENTER -> CHANNEL_FRONT_CENTER
  Correct:  CHANNEL_LFE -> CHANNEL_LFE
  Wrong:    CHANNEL_SIDE_LEFT -> CHANNEL_BACK_LEFT
  Wrong:    CHANNEL_SIDE_RIGHT -> CHANNEL_BACK_RIGHT

Instead of just assuming the input channel map is a truncation of the
output channel map and has channels in the same order, just keep the
existing 1:1 mappings and hope that's sufficient.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2022-08-11 09:52:43 +10:00
David Reid 1a1bd8129b Add configuration option for calculating the output LFE channel.
This is disabled by default for backwards compatibility. Use the
`calculateLFEFromSpatialChannels` config option to enable this.
2022-08-11 09:52:27 +10:00
David Reid 8517b10079 Minor style changes. 2022-08-11 09:34:05 +10:00
Steven Noonan e327450d95 channel mapping: assign LFE channel weight
If the LFE channel exists in the output channel map but not the input
channel map, we would previously just give it a weight of 0, which
caused it to not be filled.

This gives LFE a weight of 1.0f/$NumberOfSpatialChannels and basically
makes it omnidirectional.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2022-08-11 09:23:51 +10:00
David Reid 8f919e2beb Fix a channel mapping error where weights are calculated incorrectly.
The error here is that exactly-matching channels were not having a
weight calculated which resulted in them being silenced.

Public issue https://github.com/mackron/miniaudio/issues/480
2022-08-11 07:57:42 +10:00
Clownacy 2f0d8a4fa8 Fix an ANSI C incompatibility. 2022-08-05 08:11:19 +10:00
Zvicii 2fde0c695e fix: build error under msvc
Cast from 'void*' to pointer to non-'void' requires explicit type cast error under msvc compiler
2022-08-01 08:53:29 +10:00
jongwoon-100 32ca32ebff Fix some compile warnings in iOS 2022-07-28 10:57:54 +10:00
jongwoon-100 e099d66d0f Check api level when using backends of Android 2022-07-28 10:53:08 +10:00
jongwoon-100 3f3629517e Fix mismatched attributes of aaudio 2022-07-27 08:36:55 +10:00
David Reid c3521aeaec Fix logging with the C++ build.
Public issue https://github.com/mackron/miniaudio/issues/500
2022-07-21 10:48:58 +10:00