1 /* GStreamer ReplayGain analysis
3 * Copyright (C) 2006 Rene Stadler <mail@renestadler.de>
5 * gstrganalysis.c: Element that performs the ReplayGain analysis
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * SECTION:element-rganalysis
25 * @see_also: #GstRgVolume
27 * This element analyzes raw audio sample data in accordance with the proposed
28 * <ulink url="http://replaygain.org">ReplayGain standard</ulink> for
29 * calculating the ideal replay gain for music tracks and albums. The element
30 * is designed as a pass-through filter that never modifies any data. As it
31 * receives an EOS event, it finalizes the ongoing analysis and generates a tag
32 * list containing the results. It is sent downstream with a tag event and
33 * posted on the message bus with a tag message. The EOS event is forwarded as
34 * normal afterwards. Result tag lists at least contain the tags
35 * #GST_TAG_TRACK_GAIN, #GST_TAG_TRACK_PEAK and #GST_TAG_REFERENCE_LEVEL.
37 * Because the generated metadata tags become available at the end of streams,
38 * downstream muxer and encoder elements are normally unable to save them in
39 * their output since they generally save metadata in the file header.
40 * Therefore, it is often necessary that applications read the results in a bus
41 * event handler for the tag message. Obtaining the values this way is always
42 * needed for <link linkend="GstRgAnalysis--num-tracks">album processing</link>
43 * since the album gain and peak values need to be associated with all tracks of
44 * an album, not just the last one.
47 * <title>Example launch lines</title>
49 * gst-launch -t audiotestsrc wave=sine num-buffers=512 ! rganalysis ! fakesink
50 * ]| Analyze a simple test waveform
52 * gst-launch -t filesrc location=filename.ext ! decodebin \
53 * ! audioconvert ! audioresample ! rganalysis ! fakesink
54 * ]| Analyze a given file
56 * gst-launch -t gnomevfssrc location=http://replaygain.hydrogenaudio.org/ref_pink.wav \
57 * ! wavparse ! rganalysis ! fakesink
58 * ]| Analyze the pink noise reference file
60 * The above launch line yields a result gain of +6 dB (instead of the expected
61 * +0 dB). This is not in error, refer to the #GstRgAnalysis:reference-level
62 * property documentation for more information.
66 * <title>Acknowledgements</title>
68 * This element is based on code used in the <ulink
69 * url="http://sjeng.org/vorbisgain.html">vorbisgain</ulink> program and many
70 * others. The relevant parts are copyrighted by David Robinson, Glen Sawyer
81 #include <gst/base/gstbasetransform.h>
83 #include "gstrganalysis.h"
84 #include "replaygain.h"
86 GST_DEBUG_CATEGORY_STATIC (gst_rg_analysis_debug);
87 #define GST_CAT_DEFAULT gst_rg_analysis_debug
89 /* Default property value. */
90 #define FORCED_DEFAULT TRUE
91 #define DEFAULT_MESSAGE FALSE
102 /* The ReplayGain algorithm is intended for use with mono and stereo
103 * audio. The used implementation has filter coefficients for the
104 * "usual" sample rates in the 8000 to 48000 Hz range. */
105 #define REPLAY_GAIN_CAPS \
106 "channels = (int) { 1, 2 }, " \
107 "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, " \
110 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
111 GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-float, "
112 "width = (int) 32, " "endianness = (int) BYTE_ORDER, "
113 REPLAY_GAIN_CAPS "; "
115 "width = (int) 16, " "depth = (int) [ 1, 16 ], "
116 "signed = (boolean) true, " "endianness = (int) BYTE_ORDER, "
119 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
120 GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-float, "
121 "width = (int) 32, " "endianness = (int) BYTE_ORDER, "
122 REPLAY_GAIN_CAPS "; "
124 "width = (int) 16, " "depth = (int) [ 1, 16 ], "
125 "signed = (boolean) true, " "endianness = (int) BYTE_ORDER, "
128 GST_BOILERPLATE (GstRgAnalysis, gst_rg_analysis, GstBaseTransform,
129 GST_TYPE_BASE_TRANSFORM);
131 static void gst_rg_analysis_set_property (GObject * object, guint prop_id,
132 const GValue * value, GParamSpec * pspec);
133 static void gst_rg_analysis_get_property (GObject * object, guint prop_id,
134 GValue * value, GParamSpec * pspec);
136 static gboolean gst_rg_analysis_start (GstBaseTransform * base);
137 static gboolean gst_rg_analysis_set_caps (GstBaseTransform * base,
138 GstCaps * incaps, GstCaps * outcaps);
139 static GstFlowReturn gst_rg_analysis_transform_ip (GstBaseTransform * base,
141 static gboolean gst_rg_analysis_event (GstBaseTransform * base,
143 static gboolean gst_rg_analysis_stop (GstBaseTransform * base);
145 static void gst_rg_analysis_handle_tags (GstRgAnalysis * filter,
146 const GstTagList * tag_list);
147 static void gst_rg_analysis_handle_eos (GstRgAnalysis * filter);
148 static gboolean gst_rg_analysis_track_result (GstRgAnalysis * filter,
149 GstTagList ** tag_list);
150 static gboolean gst_rg_analysis_album_result (GstRgAnalysis * filter,
151 GstTagList ** tag_list);
154 gst_rg_analysis_base_init (gpointer g_class)
156 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
158 gst_element_class_add_pad_template (element_class,
159 gst_static_pad_template_get (&src_factory));
160 gst_element_class_add_pad_template (element_class,
161 gst_static_pad_template_get (&sink_factory));
162 gst_element_class_set_details_simple (element_class, "ReplayGain analysis",
163 "Filter/Analyzer/Audio",
164 "Perform the ReplayGain analysis",
165 "Ren\xc3\xa9 Stadler <mail@renestadler.de>");
167 GST_DEBUG_CATEGORY_INIT (gst_rg_analysis_debug, "rganalysis", 0,
168 "ReplayGain analysis element");
172 gst_rg_analysis_class_init (GstRgAnalysisClass * klass)
174 GObjectClass *gobject_class;
175 GstBaseTransformClass *trans_class;
177 gobject_class = (GObjectClass *) klass;
178 gobject_class->set_property = gst_rg_analysis_set_property;
179 gobject_class->get_property = gst_rg_analysis_get_property;
182 * GstRgAnalysis:num-tracks:
184 * Number of remaining album tracks.
186 * Analyzing several streams sequentially and assigning them a common result
187 * gain is known as "album processing". If this gain is used during playback
188 * (by switching to "album mode"), all tracks of an album receive the same
189 * amplification. This keeps the relative volume levels between the tracks
190 * intact. To enable this, set this property to the number of streams that
191 * will be processed as album tracks.
193 * Every time an EOS event is received, the value of this property is
194 * decremented by one. As it reaches zero, it is assumed that the last track
195 * of the album finished. The tag list for the final stream will contain the
196 * additional tags #GST_TAG_ALBUM_GAIN and #GST_TAG_ALBUM_PEAK. All other
197 * streams just get the two track tags posted because the values for the album
198 * tags are not known before all tracks are analyzed. Applications need to
199 * ensure that the album gain and peak values are also associated with the
200 * other tracks when storing the results.
202 * If the total number of album tracks is unknown beforehand, just ensure that
203 * the value is greater than 1 before each track starts. Then before the end
204 * of the last track, set it to the value 1.
206 * To perform album processing, the element has to preserve data between
207 * streams. This cannot survive a state change to the NULL or READY state.
208 * If you change your pipeline's state to NULL or READY between tracks, lock
209 * the element's state using gst_element_set_locked_state() when it is in
212 g_object_class_install_property (gobject_class, PROP_NUM_TRACKS,
213 g_param_spec_int ("num-tracks", "Number of album tracks",
214 "Number of remaining album tracks", 0, G_MAXINT, 0,
215 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
217 * GstRgAnalysis:forced:
219 * Whether to analyze streams even when ReplayGain tags exist.
221 * For assisting transcoder/converter applications, the element can silently
222 * skip the processing of streams that already contain the necessary tags.
223 * Data will flow as usual but the element will not consume CPU time and will
224 * not generate result tags. To enable possible skipping, set this property
227 * If used in conjunction with <link linkend="GstRgAnalysis--num-tracks">album
228 * processing</link>, the element will skip the number of remaining album
229 * tracks if a full set of tags is found for the first track. If a subsequent
230 * track of the album is missing tags, processing cannot start again. If this
231 * is undesired, the application has to scan all files beforehand and enable
232 * forcing of processing if needed.
234 g_object_class_install_property (gobject_class, PROP_FORCED,
235 g_param_spec_boolean ("forced", "Forced",
236 "Analyze even if ReplayGain tags exist",
237 FORCED_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
239 * GstRgAnalysis:reference-level:
241 * Reference level [dB].
243 * Analyzing the ReplayGain pink noise reference waveform computes a result of
244 * +6 dB instead of the expected 0 dB. This is because the default reference
245 * level is 89 dB. To obtain values as lined out in the original proposal of
246 * ReplayGain, set this property to 83.
248 * Almost all software uses 89 dB as a reference however, and this value has
249 * become the new official value. That is to say, while the change has been
250 * acclaimed by the author of the ReplayGain proposal, the <ulink
251 * url="http://replaygain.org">webpage</ulink> is still outdated at the time
254 * The value was changed because the original proposal recommends a default
255 * pre-amp value of +6 dB for playback. This seemed a bit odd, as it means
256 * that the algorithm has the general tendency to produce adjustment values
257 * that are 6 dB too low. Bumping the reference level by 6 dB compensated for
260 * The problem of the reference level being ambiguous for lack of concise
261 * standardization is to be solved by adopting the #GST_TAG_REFERENCE_LEVEL
262 * tag, which allows to store the used value alongside the gain values.
264 g_object_class_install_property (gobject_class, PROP_REFERENCE_LEVEL,
265 g_param_spec_double ("reference-level", "Reference level",
266 "Reference level [dB]", 0.0, 150., RG_REFERENCE_LEVEL,
267 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
269 g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MESSAGE,
270 g_param_spec_boolean ("message", "Message",
271 "Post statics messages",
273 G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
275 trans_class = (GstBaseTransformClass *) klass;
276 trans_class->start = GST_DEBUG_FUNCPTR (gst_rg_analysis_start);
277 trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_rg_analysis_set_caps);
278 trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_rg_analysis_transform_ip);
279 trans_class->event = GST_DEBUG_FUNCPTR (gst_rg_analysis_event);
280 trans_class->stop = GST_DEBUG_FUNCPTR (gst_rg_analysis_stop);
281 trans_class->passthrough_on_same_caps = TRUE;
285 gst_rg_analysis_init (GstRgAnalysis * filter, GstRgAnalysisClass * gclass)
287 GstBaseTransform *base = GST_BASE_TRANSFORM (filter);
289 gst_base_transform_set_gap_aware (base, TRUE);
291 filter->num_tracks = 0;
292 filter->forced = FORCED_DEFAULT;
293 filter->message = DEFAULT_MESSAGE;
294 filter->reference_level = RG_REFERENCE_LEVEL;
297 filter->analyze = NULL;
301 gst_rg_analysis_set_property (GObject * object, guint prop_id,
302 const GValue * value, GParamSpec * pspec)
304 GstRgAnalysis *filter = GST_RG_ANALYSIS (object);
306 GST_OBJECT_LOCK (filter);
308 case PROP_NUM_TRACKS:
309 filter->num_tracks = g_value_get_int (value);
312 filter->forced = g_value_get_boolean (value);
314 case PROP_REFERENCE_LEVEL:
315 filter->reference_level = g_value_get_double (value);
318 filter->message = g_value_get_boolean (value);
321 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
324 GST_OBJECT_UNLOCK (filter);
328 gst_rg_analysis_get_property (GObject * object, guint prop_id,
329 GValue * value, GParamSpec * pspec)
331 GstRgAnalysis *filter = GST_RG_ANALYSIS (object);
333 GST_OBJECT_LOCK (filter);
335 case PROP_NUM_TRACKS:
336 g_value_set_int (value, filter->num_tracks);
339 g_value_set_boolean (value, filter->forced);
341 case PROP_REFERENCE_LEVEL:
342 g_value_set_double (value, filter->reference_level);
345 g_value_set_boolean (value, filter->message);
348 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
351 GST_OBJECT_UNLOCK (filter);
355 gst_rg_analysis_post_message (gpointer rganalysis, GstClockTime timestamp,
356 GstClockTime duration, gdouble rglevel)
358 GstRgAnalysis *filter = GST_RG_ANALYSIS (rganalysis);
359 if (filter->message) {
362 m = gst_message_new_element (GST_OBJECT_CAST (rganalysis),
363 gst_structure_new ("rganalysis",
364 "timestamp", G_TYPE_UINT64, timestamp,
365 "duration", G_TYPE_UINT64, duration,
366 "rglevel", G_TYPE_DOUBLE, rglevel, NULL));
368 gst_element_post_message (GST_ELEMENT_CAST (rganalysis), m);
374 gst_rg_analysis_start (GstBaseTransform * base)
376 GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
378 filter->ignore_tags = FALSE;
379 filter->skip = FALSE;
380 filter->has_track_gain = FALSE;
381 filter->has_track_peak = FALSE;
382 filter->has_album_gain = FALSE;
383 filter->has_album_peak = FALSE;
385 filter->ctx = rg_analysis_new ();
386 GST_OBJECT_LOCK (filter);
387 rg_analysis_init_silence_detection (filter->ctx, gst_rg_analysis_post_message,
389 GST_OBJECT_UNLOCK (filter);
390 filter->analyze = NULL;
392 GST_LOG_OBJECT (filter, "started");
398 gst_rg_analysis_set_caps (GstBaseTransform * base, GstCaps * in_caps,
401 GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
402 GstStructure *structure;
404 gint n_channels, sample_rate, sample_bit_size, sample_size;
406 g_return_val_if_fail (filter->ctx != NULL, FALSE);
408 GST_DEBUG_OBJECT (filter,
409 "set_caps in %" GST_PTR_FORMAT " out %" GST_PTR_FORMAT,
412 structure = gst_caps_get_structure (in_caps, 0);
413 name = gst_structure_get_name (structure);
415 if (!gst_structure_get_int (structure, "width", &sample_bit_size)
416 || !gst_structure_get_int (structure, "channels", &n_channels)
417 || !gst_structure_get_int (structure, "rate", &sample_rate))
420 if (!rg_analysis_set_sample_rate (filter->ctx, sample_rate))
423 if (sample_bit_size % 8 != 0)
425 sample_size = sample_bit_size / 8;
427 if (g_str_equal (name, "audio/x-raw-float")) {
429 if (sample_size != sizeof (gfloat))
432 /* The depth is not variable for float formats of course. It just
433 * makes the transform function nice and simple if the
434 * rg_analysis_analyze_* functions have a common signature. */
435 filter->depth = sizeof (gfloat) * 8;
438 filter->analyze = rg_analysis_analyze_mono_float;
439 else if (n_channels == 2)
440 filter->analyze = rg_analysis_analyze_stereo_float;
444 } else if (g_str_equal (name, "audio/x-raw-int")) {
446 if (sample_size != sizeof (gint16))
449 if (!gst_structure_get_int (structure, "depth", &filter->depth))
451 if (filter->depth < 1 || filter->depth > 16)
455 filter->analyze = rg_analysis_analyze_mono_int16;
456 else if (n_channels == 2)
457 filter->analyze = rg_analysis_analyze_stereo_int16;
471 filter->analyze = NULL;
472 GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION,
473 ("Invalid incoming caps: %" GST_PTR_FORMAT, in_caps), (NULL));
479 gst_rg_analysis_transform_ip (GstBaseTransform * base, GstBuffer * buf)
481 GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
483 g_return_val_if_fail (filter->ctx != NULL, GST_FLOW_WRONG_STATE);
484 g_return_val_if_fail (filter->analyze != NULL, GST_FLOW_NOT_NEGOTIATED);
489 GST_LOG_OBJECT (filter, "processing buffer of size %u",
490 GST_BUFFER_SIZE (buf));
492 rg_analysis_start_buffer (filter->ctx, GST_BUFFER_TIMESTAMP (buf));
493 filter->analyze (filter->ctx, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf),
500 gst_rg_analysis_event (GstBaseTransform * base, GstEvent * event)
502 GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
504 g_return_val_if_fail (filter->ctx != NULL, TRUE);
506 switch (GST_EVENT_TYPE (event)) {
510 GST_LOG_OBJECT (filter, "received EOS event");
512 gst_rg_analysis_handle_eos (filter);
514 GST_LOG_OBJECT (filter, "passing on EOS event");
520 GstTagList *tag_list;
522 /* The reference to the tag list is borrowed. */
523 gst_event_parse_tag (event, &tag_list);
524 gst_rg_analysis_handle_tags (filter, tag_list);
532 return GST_BASE_TRANSFORM_CLASS (parent_class)->event (base, event);
536 gst_rg_analysis_stop (GstBaseTransform * base)
538 GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
540 g_return_val_if_fail (filter->ctx != NULL, FALSE);
542 rg_analysis_destroy (filter->ctx);
545 GST_LOG_OBJECT (filter, "stopped");
551 gst_rg_analysis_handle_tags (GstRgAnalysis * filter,
552 const GstTagList * tag_list)
554 gboolean album_processing = (filter->num_tracks > 0);
557 if (!album_processing)
558 filter->ignore_tags = FALSE;
560 if (filter->skip && album_processing) {
561 GST_DEBUG_OBJECT (filter, "ignoring tag event: skipping album");
563 } else if (filter->skip) {
564 GST_DEBUG_OBJECT (filter, "ignoring tag event: skipping track");
566 } else if (filter->ignore_tags) {
567 GST_DEBUG_OBJECT (filter, "ignoring tag event: cannot skip anyways");
571 filter->has_track_gain |= gst_tag_list_get_double (tag_list,
572 GST_TAG_TRACK_GAIN, &dummy);
573 filter->has_track_peak |= gst_tag_list_get_double (tag_list,
574 GST_TAG_TRACK_PEAK, &dummy);
575 filter->has_album_gain |= gst_tag_list_get_double (tag_list,
576 GST_TAG_ALBUM_GAIN, &dummy);
577 filter->has_album_peak |= gst_tag_list_get_double (tag_list,
578 GST_TAG_ALBUM_PEAK, &dummy);
580 if (!(filter->has_track_gain && filter->has_track_peak)) {
581 GST_DEBUG_OBJECT (filter, "track tags not complete yet");
585 if (album_processing && !(filter->has_album_gain && filter->has_album_peak)) {
586 GST_DEBUG_OBJECT (filter, "album tags not complete yet");
590 if (filter->forced) {
591 GST_DEBUG_OBJECT (filter,
592 "existing tags are sufficient, but processing anyway (forced)");
597 rg_analysis_reset (filter->ctx);
599 if (!album_processing) {
600 GST_DEBUG_OBJECT (filter,
601 "existing tags are sufficient, will not process this track");
603 GST_DEBUG_OBJECT (filter,
604 "existing tags are sufficient, will not process this album");
609 gst_rg_analysis_handle_eos (GstRgAnalysis * filter)
611 gboolean album_processing = (filter->num_tracks > 0);
612 gboolean album_finished = (filter->num_tracks == 1);
613 gboolean album_skipping = album_processing && filter->skip;
615 filter->has_track_gain = FALSE;
616 filter->has_track_peak = FALSE;
618 if (album_finished) {
619 filter->ignore_tags = FALSE;
620 filter->skip = FALSE;
621 filter->has_album_gain = FALSE;
622 filter->has_album_peak = FALSE;
623 } else if (!album_skipping) {
624 filter->skip = FALSE;
627 /* We might have just fully processed a track because it has
628 * incomplete tags. If we do album processing and allow skipping
629 * (not forced), prevent switching to skipping if a later track with
630 * full tags comes along: */
631 if (!filter->forced && album_processing && !album_finished)
632 filter->ignore_tags = TRUE;
635 GstTagList *tag_list = NULL;
636 gboolean track_success;
637 gboolean album_success = FALSE;
639 track_success = gst_rg_analysis_track_result (filter, &tag_list);
642 album_success = gst_rg_analysis_album_result (filter, &tag_list);
643 else if (!album_processing)
644 rg_analysis_reset_album (filter->ctx);
646 if (track_success || album_success) {
647 GST_LOG_OBJECT (filter, "posting tag list with results");
648 gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND,
649 GST_TAG_REFERENCE_LEVEL, filter->reference_level, NULL);
650 /* This steals our reference to the list: */
651 gst_element_found_tags_for_pad (GST_ELEMENT (filter),
652 GST_BASE_TRANSFORM_SRC_PAD (GST_BASE_TRANSFORM (filter)), tag_list);
656 if (album_processing) {
657 filter->num_tracks--;
659 if (!album_finished) {
660 GST_DEBUG_OBJECT (filter, "album not finished yet (num-tracks is now %u)",
663 GST_DEBUG_OBJECT (filter, "album finished (num-tracks is now 0)");
667 if (album_processing)
668 g_object_notify (G_OBJECT (filter), "num-tracks");
672 gst_rg_analysis_track_result (GstRgAnalysis * filter, GstTagList ** tag_list)
674 gboolean track_success;
675 gdouble track_gain, track_peak;
677 track_success = rg_analysis_track_result (filter->ctx, &track_gain,
681 track_gain += filter->reference_level - RG_REFERENCE_LEVEL;
682 GST_INFO_OBJECT (filter, "track gain is %+.2f dB, peak %.6f", track_gain,
685 GST_INFO_OBJECT (filter, "track was too short to analyze");
689 if (*tag_list == NULL)
690 *tag_list = gst_tag_list_new ();
691 gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
692 GST_TAG_TRACK_PEAK, track_peak, GST_TAG_TRACK_GAIN, track_gain, NULL);
695 return track_success;
699 gst_rg_analysis_album_result (GstRgAnalysis * filter, GstTagList ** tag_list)
701 gboolean album_success;
702 gdouble album_gain, album_peak;
704 album_success = rg_analysis_album_result (filter->ctx, &album_gain,
708 album_gain += filter->reference_level - RG_REFERENCE_LEVEL;
709 GST_INFO_OBJECT (filter, "album gain is %+.2f dB, peak %.6f", album_gain,
712 GST_INFO_OBJECT (filter, "album was too short to analyze");
716 if (*tag_list == NULL)
717 *tag_list = gst_tag_list_new ();
718 gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
719 GST_TAG_ALBUM_PEAK, album_peak, GST_TAG_ALBUM_GAIN, album_gain, NULL);
722 return album_success;