π π A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
Move samples-per-frame logic into MP3Frame struct.
Peter Sobote8bfed3b9c9d
diff --git a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cppindex 4d2bc0a..c161711 100644--- a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp+++ b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp@@ -814,6 +814,18 @@ struct MP3Frame {return ParseSuccessful::yes;}+ int numSamples() const {+ switch (layer) {+ case 1:+ return 384;+ case 3:+ if (lsf)+ return 576;+ default:+ return 1152;+ }+ }+int layer, frameSize, numChannels, single;int lsf; // 0 = mpeg-1, 1 = mpeg-2/LSFbool mpeg25; // true = mpeg-2.5, false = mpeg-1/2@@ -3282,11 +3294,7 @@ public:usesFloatingPointData = true;sampleRate = stream.frame.getFrequency();numChannels = (unsigned int)stream.frame.numChannels;- if (sampleRate >= 32000) {- samplesPerFrame = 1152;- } else {- samplesPerFrame = 576;- }+ samplesPerFrame = stream.frame.numSamples();lengthInSamples = findLength(streamPos);}}