1 /* GStreamer ReplayGain analysis
3 * Copyright (C) 2006 Rene Stadler <mail@renestadler.de>
4 * Copyright (C) 2001 David Robinson <David@Robinson.org>
5 * Glen Sawyer <glensawyer@hotmail.com>
7 * rganalysis.h: Analyze raw audio data in accordance with ReplayGain
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #ifndef __RG_ANALYSIS_H__
26 #define __RG_ANALYSIS_H__
33 typedef struct _RgAnalysisCtx RgAnalysisCtx;
35 RgAnalysisCtx *rg_analysis_new (void);
36 gboolean rg_analysis_set_sample_rate (RgAnalysisCtx * ctx, gint sample_rate);
37 void rg_analysis_analyze_mono_float (RgAnalysisCtx * ctx, gconstpointer data,
38 gsize size, guint depth);
39 void rg_analysis_analyze_stereo_float (RgAnalysisCtx * ctx, gconstpointer data,
40 gsize size, guint depth);
41 void rg_analysis_analyze_mono_int16 (RgAnalysisCtx * ctx, gconstpointer data,
42 gsize size, guint depth);
43 void rg_analysis_analyze_stereo_int16 (RgAnalysisCtx * ctx, gconstpointer data,
44 gsize size, guint depth);
45 void rg_analysis_analyze (RgAnalysisCtx * ctx, const gfloat * samples_l,
46 const gfloat * samples_r, guint n_samples);
47 gboolean rg_analysis_track_result (RgAnalysisCtx * ctx, gdouble * gain,
49 gboolean rg_analysis_album_result (RgAnalysisCtx * ctx, gdouble * gain,
51 void rg_analysis_init_silence_detection (
53 void (*post_message) (gpointer analysis, GstClockTime timestamp, GstClockTime duration, gdouble rglevel),
55 void rg_analysis_start_buffer (RgAnalysisCtx * ctx,
56 GstClockTime buffer_timestamp);
57 void rg_analysis_reset_album (RgAnalysisCtx * ctx);
58 void rg_analysis_reset (RgAnalysisCtx * ctx);
59 void rg_analysis_destroy (RgAnalysisCtx * ctx);
63 #endif /* __RG_ANALYSIS_H__ */