'Get the gain result pair from PyAudioTools using the `ReplayGain`
instance `rg` for the given `audiofile`.
Wraps `rg.title_gain(audiofile.to_pcm())` and throws a
`ReplayGainError` when the library fails.'

def _title_gain(self, rg, audiofile):

    try:
        return rg.title_gain(audiofile.to_pcm())
    except ValueError as exc:
        self._log.debug(u'error    in    rg.title_gain()    call:    {}', exc)
        raise ReplayGainError(u'audiotools    audio    data    error')
