1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

WaveAudioFormatWriter: Don't add an extended format chunk if the wav file only has one or two channels

This commit is contained in:
hogliux 2017-07-31 12:58:03 +01:00
parent 0cf21a4b72
commit fb310f7876

View file

@ -1476,7 +1476,12 @@ private:
static int getChannelMaskFromChannelLayout (const AudioChannelSet& channelLayout)
{
if (channelLayout.isDiscreteLayout() || channelLayout == AudioChannelSet::mono())
if (channelLayout.isDiscreteLayout())
return 0;
// Don't add an extended format chunk for mono and stereo. Basically, all wav players
// interpret a wav file with only one or two channels to be mono or stereo anyway.
if (channelLayout == AudioChannelSet::mono() || channelLayout == AudioChannelSet::stereo())
return 0;
auto channels = channelLayout.getChannelTypes();