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