rgvolume is not adjusting volume?

Cy cy at verge.info.tm
Mon Jan 2 17:35:48 PST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I used rganalysis to get peak (whatever that is) gain and reference
level on my songs. Now I'd like to apply that adjustment via rgvolume,
but I can't get any detectable difference to occur whether I use it or
not.

In my code I am creating a GstMessage using the values that rganalysis
put out earlier (loaded from a database) and a null source, then
gst_bus_post to post the message. My gst_bus_add_watch callback
displays those tags correctly during playback, giving me the impression
that they have been properly dispatched. And I have a rgvolume element
both added and linked right before alsasink.

But the volume remains unchanged. Loud songs are still too loud. Quiet
songs are still too quiet. For the song I'm testing the gain is 2.13,
peak 0.512525 and reference level 89. It should sound distinguishably
different when adjusted. But I can't hear any amplification going on.

I realize you can't just do this:
gst-launch-0.10 filesrc location=somewhere.mp3 ! audioconvert ! audioresample ! rganalysis ! rgvolume ! alsasink

...because the analysis cannot produce a result until the end of
stream. For that reason I already performed the analysis just to a
fakesink, and stored those results in a database. Supposedly I can then
produce those results as tags during the actual playback and have 
rgvolume adjust the volume so that artificially dampened songs play 
just as well as artificially amplified ones.

I can't use the GstTagSetter interface, because all the ones
implementing that are for encoding songs and saving them to file not
playing them out loud.

here's the code where I add the tags:
...
  gdouble gain = g_ascii_strtod(PQgetvalue(result,0,1),&end);
  gdouble peak = g_ascii_strtod(PQgetvalue(result,0,2),&end);
  gdouble level =  g_ascii_strtod(PQgetvalue(result,0,3),&end);

  if(!getenv("noreplaygain")) {
    static GstTagList* list = NULL;
    if(list==NULL)
      list = gst_tag_list_new();
    gst_tag_list_add(list, GST_TAG_MERGE_REPLACE,
                     GST_TAG_TRACK_GAIN, gain,
                     GST_TAG_TRACK_PEAK, peak,
                     GST_TAG_REFERENCE_LEVEL, level,
                     NULL);
    
    GstMessage* message = gst_message_new_tag(NULL,list);
    gst_bus_post(bus,message);
    //gst_message_unref(message);
  }
... 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBCAAGBQJPAlt1AAoJEF1ecRpMzcFybaEH/34AIaP2idC26aUWy8UyOuyN
O8oJ6/73lQXSVhFyD56jCKGeAwbSI+1++WxXc5Ukw1uizFzTgUp6e8G5lWauh13E
sLhBxe4KD3pZaRVgEWpFM3mLDvW7e1ea7QW88R6ACd63nns0NKLSQClOZqIIt3b1
m1LcXbUNv3YSS7QMbzEqROqmBtB+gDp3jAxxb9ENquv57aDbOfkS9USqJ9k7LU/k
u7RSodK1nCpQJWhEitfbstoER/6z0r3mRg/Jat9IDPX16XyHuFJ+Ci3GjD9GUPy2
BIno3a3OjOPYhNHUKHGlCfhdlAQEdAYtnNsPsmVtOog+nAtzyyyqMKEgsjWitbA=
=X/S3
-----END PGP SIGNATURE-----


More information about the gstreamer-devel mailing list