```
$ sox -n rp.mp3 synth 3 sine 500
$ ffmpeg -i rp.mp3 rp.ogg
$ ffmpeg -i rp.mp3 rp.m4a
$ mp3gain -s i rp.mp3
$ vorbisgain rp.ogg
$ aacgain rp.m4a
$ ffprobe rp.mp3
Input #0, mp3, from 'rp-i.mp3':
  Metadata:
    replaygain_reference_loudness: 89.0 dB
    replaygain_track_gain: -4.220000 dB
    replaygain_track_peak: 0.307712
    MP3GAIN_MINMAX  : 134,177
  Duration: 00:00:03.02, start: 0.000000, bitrate: 69 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, mono, fltp, 64 kb/s
    Side data:
      replaygain: track gain - -4.220000, track peak - 0.000007, album gain - 
unknown, album peak - unknown,
$ ffprobe rp.ogg
Input #0, ogg, from 'rp.ogg':
  Duration: 00:00:03.02, start: 0.000000, bitrate: 26 kb/s
    Stream #0:0: Audio: vorbis, 48000 Hz, mono, fltp, 80 kb/s
    Metadata:
      ENCODER         : Lavc58.35.100 libvorbis
      REPLAYGAIN_TRACK_PEAK: 0.31471366
      REPLAYGAIN_TRACK_GAIN: -4.28 dB
    Side data:
      replaygain: track gain - -4.280000, track peak - 0.000007, album gain - 
unknown, album peak - unknown,
$ ffprobe rp.m4a
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rp.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf58.20.100
    replaygain_track_peak: 0.31
    replaygain_track_gain: -4.22
    replaygain_track_minmax: 117,148
  Duration: 00:00:03.05, start: 0.000000, bitrate: 56 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, 
fltp, 52 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Side data:
      replaygain: track gain - -4.220000, track peak - 0.000007, album gain - 
unknown, album peak - unknown,
```
Seems like vorbisgain is the only one who read [the 
doc](https://wiki.hydrogenaud.io/index.php?title=ReplayGain_specification):
- the metadata must be in upper case
- mp3 files should use ID3v2 (it's ape by default with mp3gain)
- the gain must be with a "dB" prefix

Additionally, [`liquidsoap` seem to require a leading space in the metadata 
value](https://github.com/savonet/liquidsoap/blob/3350999c9efe447d8a226d59ffc061ce55004580/src/operators/amplify.ml#L47),
 in contradiction with [the 
doc](https://www.liquidsoap.info/doc-dev/reference.html#amplify).

The only way I see out of this madness, outside from fixing these tools/finding 
spec-compliant ones, would be to make the ` dB` prefix optional and the 
metadata name case insensitive. Since this is specific to `replaygain`, a new 
`replaygain` operator could be created as a `amplify` wrapper.

Bonus point if this operator supports preamp and clipping prevention as 
required by the spec. It could also be added as a note to use `amplify` in the 
doc.

What do you think?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/749
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to