gives bogus values

Bug #1225557 reported by Andrew Kelley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libreplaygain (Ubuntu)
New
Undecided
Unassigned

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?

Revision history for this message
Andrew Kelley (andrewrk) wrote :

In my opinion this module should be pulled in favor of https://github.com/jiixyj/libebur128

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.