-
Notifications
You must be signed in to change notification settings - Fork 1
/
stagger_to_track.py
56 lines (36 loc) · 942 Bytes
/
stagger_to_track.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/python3
# id3ed.py -- module handle communication with id3ed
# @Author: The Sighter (sighter@resource-dnb.de)
# @License: GPL
# @Created: 2010-12-04.
# @Revision: 0.1
from release import track
import stagger
from stagger.id3 import *
# function -- id3_to_track
# @ filename
# < a new trak instance
# fetches information using the stagger lib
# ***************************************** #
def id3_to_track (filepath):
sFktname = "id3_to_track"
tag = stagger.read_tag(filepath)
track_new = track()
track_new["artist"] = tag.artist
track_new["title"] = tag.title
track_new["tn"] = tag.track
return track_new
# end of id3_to_track
# function -- main
# @ none
# < none
# testing function
# **************** #
def main ():
sFktname = "main"
filename = "Noisia_Crank_Original_Mix.wav"
track_new = id3_to_track(filename)
print(track_new)
# end of main
if __name__ == "__main__":
main()