Public bug reported:

Here's an example file: http://superjoe.s3.amazonaws.com/temp/test-
rg.mp3

When I run the "mp3gain" cli tool on it, I get this:

Recommended "Track" dB change: -0.730000         
Recommended "Track" mp3 gain change: 0
Max PCM sample at current gain: 7739.570901
Max mp3 global gain field: 150
Min mp3 global gain field: 128

Seems reasonable.

But when I use my own program to feed data into libreplaygain I get
bogus results. I looked into this further and created a simple test case
that fails.

Here's the test file, converted to 44100 Hz, mono, 64-bit float raw file:
http://superjoe.s3.amazonaws.com/temp/test-rg-44100-64bit-mono.raw

Here's some C code relying on libreplaygain to parse the file:

#include <stdio.h>
#include <replaygain/gain_analysis.h>

int main (int argc, char **argv)
{
    FILE *file = fopen(argv[1], "rb");
    double buf[50000];
    size_t bytes_read = fread(buf, 1, 400000, file);
    gain_init_analysis(44100);
    gain_analyze_samples(buf, NULL, bytes_read / 8, 1);
    fclose(file);
    printf("analyzed %lu samples\n", bytes_read / 8);
    printf("track gain: %f\n", gain_get_title());
}


When I run this, I see:
analyzed 47232 samples
track gain: 0.000000


Am I missing something? Is there anywhere that a working replaygain example 
exists, perhaps a bit simpler than the source to mp3gain?

** Affects: libreplaygain (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libreplaygain in Ubuntu.
https://bugs.launchpad.net/bugs/1225557

Title:
  gives bogus values

Status in “libreplaygain” package in Ubuntu:
  New

Bug description:
  Here's an example file: http://superjoe.s3.amazonaws.com/temp/test-
  rg.mp3

  When I run the "mp3gain" cli tool on it, I get this:

  Recommended "Track" dB change: -0.730000         
  Recommended "Track" mp3 gain change: 0
  Max PCM sample at current gain: 7739.570901
  Max mp3 global gain field: 150
  Min mp3 global gain field: 128

  Seems reasonable.

  But when I use my own program to feed data into libreplaygain I get
  bogus results. I looked into this further and created a simple test
  case that fails.

  Here's the test file, converted to 44100 Hz, mono, 64-bit float raw file:
  http://superjoe.s3.amazonaws.com/temp/test-rg-44100-64bit-mono.raw

  Here's some C code relying on libreplaygain to parse the file:

  #include <stdio.h>
  #include <replaygain/gain_analysis.h>

  int main (int argc, char **argv)
  {
      FILE *file = fopen(argv[1], "rb");
      double buf[50000];
      size_t bytes_read = fread(buf, 1, 400000, file);
      gain_init_analysis(44100);
      gain_analyze_samples(buf, NULL, bytes_read / 8, 1);
      fclose(file);
      printf("analyzed %lu samples\n", bytes_read / 8);
      printf("track gain: %f\n", gain_get_title());
  }

  
  When I run this, I see:
  analyzed 47232 samples
  track gain: 0.000000

  
  Am I missing something? Is there anywhere that a working replaygain example 
exists, perhaps a bit simpler than the source to mp3gain?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libreplaygain/+bug/1225557/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to