repl.it
@mcparadip/

MusicTag

Python 2.7

No description

fork
loading
Files
  • main.py
  • 01.flac
  • 02.flac
  • 03.flac
  • 04.flac
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from tinytag import TinyTag
import discid

first = 1
last = 4
sectors = 0
offsets = [0]

for i in range(first, last + 1):
    data = TinyTag.get("0" + str(i) + ".flac")
    t_sectors = data.duration * 75
    sectors += t_sectors
    offsets.append(offsets[-1] + t_sectors)

print first, last, sectors, offsets
Fetching token
?