Browse Source

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

tags/2021-05-28
hogliux 7 years ago
parent
commit
a4d4e9e5b0
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp

+ 6
- 1
modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp 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();


Loading…
Cancel
Save