diff data/fileio/CodedAudioFileReader.h @ 1305:9f9f55a8af92 mp3-gapless

Add gapless flag to MP3FileReader, and implement trimming the delay samples from the start (padding is not yet trimmed from end)
author Chris Cannam
date Tue, 29 Nov 2016 11:35:56 +0000
parents 40c042780bc9
children b325e91505b5
line wrap: on
line diff
--- a/data/fileio/CodedAudioFileReader.h	Tue Nov 29 08:58:50 2016 +0000
+++ b/data/fileio/CodedAudioFileReader.h	Tue Nov 29 11:35:56 2016 +0000
@@ -62,6 +62,9 @@
 
     void initialiseDecodeCache(); // samplerate, channels must have been set
 
+    // compensation for encoder delays:
+    void setSamplesToTrim(sv_frame_t fromStart, sv_frame_t fromEnd);
+    
     // may throw InsufficientDiscSpace:
     void addSamplesToDecodeCache(float **samples, sv_frame_t nframes);
     void addSamplesToDecodeCache(float *samplesInterleaved, sv_frame_t nframes);
@@ -104,6 +107,9 @@
     float m_max;
     float m_gain;
 
+    sv_frame_t m_trimFromStart;
+    sv_frame_t m_trimFromEnd;
+    
     sv_frame_t m_clippedCount;
     sv_frame_t m_firstNonzero;
     sv_frame_t m_lastNonzero;