def freedb_disc_id(self): """returns a FreeDB DiscID object""" from audiotools.freedb import DiscID PTS_PER_FRAME = DVDAudio.PTS_PER_SECOND // 75 offsets = [150] for track in self.tracks[0:-1]: offsets.append(offsets[-1] + (track.pts_length // PTS_PER_FRAME)) return DiscID(offsets=offsets, total_length=self.pts_length // DVDAudio.PTS_PER_SECOND, track_count=len(self))
def musicbrainz_disc_id(self): """returns a MusicBrainz DiscID object""" from audiotools.musicbrainz import DiscID PTS_PER_FRAME = DVDAudio.PTS_PER_SECOND // 75 offsets = [150] for track in self.tracks[0:-1]: offsets.append(offsets[-1] + (track.pts_length // PTS_PER_FRAME)) return DiscID(first_track_number=1, last_track_number=len(self), lead_out_offset=self.pts_length // PTS_PER_FRAME, offsets=offsets)