Chris@1: /* Chris@1: * ReplayGainAnalysis - analyzes input samples and give the recommended dB change Chris@1: * Copyright (C) 2001 David Robinson and Glen Sawyer Chris@1: * Chris@1: * This library is free software; you can redistribute it and/or Chris@1: * modify it under the terms of the GNU Lesser General Public Chris@1: * License as published by the Free Software Foundation; either Chris@1: * version 2.1 of the License, or (at your option) any later version. Chris@1: * Chris@1: * This library is distributed in the hope that it will be useful, Chris@1: * but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Chris@1: * Lesser General Public License for more details. Chris@1: * Chris@1: * You should have received a copy of the GNU Lesser General Public Chris@1: * License along with this library; if not, write to the Free Software Chris@1: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Chris@1: * Chris@1: * concept and filter values by David Robinson (David@Robinson.org) Chris@1: * -- blame him if you think the idea is flawed Chris@1: * coding by Glen Sawyer (glensawyer@hotmail.com) 442 N 700 E, Provo, UT 84606 USA Chris@1: * -- blame him if you think this runs too slowly, or the coding is otherwise flawed Chris@1: * minor cosmetic tweaks to integrate with FLAC by Josh Coalson Chris@1: * Chris@1: * For an explanation of the concepts and the basic algorithms involved, go to: Chris@1: * http://www.replaygain.org/ Chris@1: */ Chris@1: Chris@1: #ifndef GAIN_ANALYSIS_H Chris@1: #define GAIN_ANALYSIS_H Chris@1: Chris@1: #include Chris@1: Chris@1: #define GAIN_NOT_ENOUGH_SAMPLES -24601 Chris@1: #define GAIN_ANALYSIS_ERROR 0 Chris@1: #define GAIN_ANALYSIS_OK 1 Chris@1: Chris@1: #define INIT_GAIN_ANALYSIS_ERROR 0 Chris@1: #define INIT_GAIN_ANALYSIS_OK 1 Chris@1: Chris@1: #ifdef __cplusplus Chris@1: extern "C" { Chris@1: #endif Chris@1: Chris@1: typedef float Float_t; /* Type used for filtering */ Chris@1: Chris@1: extern Float_t ReplayGainReferenceLoudness; /* in dB SPL, currently == 89.0 */ Chris@1: Chris@1: int InitGainAnalysis ( long samplefreq ); Chris@1: int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels ); Chris@1: int ResetSampleFrequency ( long samplefreq ); Chris@1: Float_t GetTitleGain ( void ); Chris@1: Float_t GetAlbumGain ( void ); Chris@1: Chris@1: #ifdef __cplusplus Chris@1: } Chris@1: #endif Chris@1: Chris@1: #endif /* GAIN_ANALYSIS_H */