Commit Graph

3198 Commits

Author SHA1 Message Date
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
David Reid 6acc98c909 Update changes. 2022-07-20 11:32:40 +10:00
David Reid 71d4667646 Fix an unaligned access error.
Public issue https://github.com/mackron/miniaudio/issues/499
2022-07-20 10:22:58 +10:00
David Reid fee921e802 Add debug output for device channel maps. 2022-07-16 08:13:57 +10:00
David Reid 15bbd4ac54 Fix compilation error when compiling with MA_NO_DEVICE_IO. 2022-07-16 07:28:36 +10:00
David Reid ad1171b2f3 Fix an error when the channel mask reported by Windows is all zero.
Public issue https://github.com/mackron/miniaudio/issues/493
2022-07-16 07:21:07 +10:00
David Reid 513c436b1a WASAPI: Fix an incorrect format detection error.
Public issue https://github.com/mackron/miniaudio/issues/494
2022-07-07 15:52:55 +10:00
David Reid c94cf44534 Fix an documentation error. 2022-06-25 19:41:22 +10:00
David Reid f6e5cf10ae Fix a crash when initializing a channel converter.
Public issue https://github.com/mackron/miniaudio/issues/482
2022-06-25 18:11:17 +10:00
David Reid 0788be818b verblib: Try fixing an issue in stereo mode. 2022-06-25 18:04:40 +10:00
David Reid 431bea6cfb Add a comment about default backend priorities. 2022-06-22 17:50:32 +10:00
David Reid 702c1cb37d Another documentation fix. 2022-06-21 16:28:55 +10:00
David Reid 0416e85745 Fix an error in the documentation for noFixedSizedCallback.
Public issue https://github.com/mackron/miniaudio/issues/485
2022-06-21 16:18:03 +10:00
David Reid eb2563d8c0 Add missing compile time options to documentation. 2022-06-21 09:08:12 +10:00
David Reid 02c02990b0 Remove unused link from readme. 2022-06-21 08:21:17 +10:00
David Reid b6b3fbfb55 Update revision history and version number. 2022-06-12 17:55:24 +10:00
iarwain b196098fda Added notificationCallback to ma_engine_config 2022-06-12 17:50:12 +10:00
David Reid 80b9fa63ee Update stb_vorbis.
Pubic issue https://github.com/mackron/miniaudio/issues/469
2022-05-15 07:20:21 +10:00
David Reid 772970ff6a Fix a typo. 2022-05-11 20:39:10 +10:00
David Reid 4d813cfe23 Update date on change history. 2022-04-20 20:20:41 +10:00
David Reid 4dfe7c4c31 Version 0.11.9 2022-04-20 20:14:51 +10:00
David Reid c2931a92cc Remove the unofficial bindings section from the readme.
These projects are not updated to the latest version.
2022-04-16 15:32:07 +10:00
David Reid e7dfd77a97 Update change history. 2022-04-10 21:53:04 +10:00
David Reid 4a1d9edff3 iOS: Fix build when ARC is not enabled. 2022-04-10 20:13:57 +10:00
David Reid ae066d57e9 Fix compilation error with older versions of GCC. 2022-04-10 20:00:05 +10:00
David Reid 804585ae2c Update dr_libs. 2022-04-10 19:56:51 +10:00
David Reid 0929f8c8f5 Don't seek streams when not changing the actual cursor position. 2022-04-10 18:44:03 +10:00
David Reid 7c8668103f Fix a subtle bug when seeking back to the start of a decoder. 2022-04-10 12:00:01 +10:00
David Reid 182ae37047 Add the notion of samples rates to audio buffers. 2022-03-30 18:05:17 +10:00
David Reid 9c338c5882 Fix a crash when seeking with ma_sound_seek_to_pcm_frame(). 2022-03-30 17:50:18 +10:00
David Reid 09f54c3712 Update revision history. 2022-03-29 09:35:54 +10:00
David Reid b9cb2db8f4 Fix a bug in ma_audio_buffer_ref_read_pcm_frames().
The bug here is the pFramesOut pointer was not getting offset correctly
when looping.

Public issue https://github.com/mackron/miniaudio/issues/442
2022-03-17 20:17:18 +10:00
David Reid 1e82e4ff20 Add MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_UNKNOWN_LENGTH.
This is a hint to the resource manager that the length of the data
source is unknown and calling ma_data_source_get_length_in_pcm_frames()
should be avoided.

Public issue https://github.com/mackron/miniaudio/discussions/439
2022-03-02 06:32:23 +10:00
David Reid 0a214db53e Clarify scheduling of sound start times. 2022-03-02 05:56:18 +10:00
David Reid eebdd2960d Fix some bugs where looping doesn't work with the resource manager. 2022-02-18 18:10:50 +10:00
David Reid 82e70f4cbe Version 0.11.8 2022-02-12 19:56:49 +10:00
David Reid 04cd4f1953 Update dr_flac. 2022-02-12 19:50:08 +10:00
David Reid f16eea138f Simplify ARM NEON detection. 2022-02-12 19:11:46 +10:00
David Reid 0d1eb42d06 Remove documentation for MA_DLL.
It is not recommended to use this option because miniaudio never
maintains ABI compatibility between versions, not even revisions.

Public issue https://github.com/mackron/miniaudio/issues/428
2022-02-11 19:11:39 +10:00
David Reid f83341e46f Update revision history. 2022-02-11 19:08:23 +10:00