Browse Source

Fix for reading IEEE float wav files.

tags/2021-05-28
jules 12 years ago
parent
commit
0cea511c0c
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp

+ 7
- 3
modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp View File

@@ -517,6 +517,10 @@ namespace WavFileHelpers
uint16 data2;
uint16 data3;
uint8 data4[8];
bool operator== (const ExtensibleWavSubFormat& other) const noexcept { return memcmp (this, &other, sizeof (*this)) == 0; }
bool operator!= (const ExtensibleWavSubFormat& other) const noexcept { return ! operator== (other); }
} JUCE_PACKED;
static const ExtensibleWavSubFormat pcmFormat = { 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } };
@@ -639,9 +643,9 @@ public:
subFormat.data3 = (uint16) input->readShort();
input->read (subFormat.data4, sizeof (subFormat.data4));
if (memcmp (&subFormat, &pcmFormat, sizeof (subFormat)) != 0
&& memcmp (&subFormat, &IEEEFloatFormat, sizeof (subFormat)) != 0
&& memcmp (&subFormat, &ambisonicFormat, sizeof (subFormat)) != 0)
if (subFormat == IEEEFloatFormat)
usesFloatingPointData = true;
else if (subFormat != pcmFormat && subFormat != ambisonicFormat)
bytesPerFrame = 0;
}
}


Loading…
Cancel
Save