PDA

View Full Version : Getting .wav ID Tags in python



dbsmith
04-14-2010, 10:03 PM
Hey,
Just trying to do some simple things in Python on a .wav file.
When i mouse hover over the .wav file in windows explorer, I can see the ID Tag info fine. But when I try and query it, I get nothing.

I'm using 64bit Windows 7, which may be the problem (?)

Code (changed comments from hash to // ):


import win32com.client
dmc = win32com.client.Dispatch("dMCScripting.Converter")

// Read audio properties on file
audioProperties = dmc.AudioProperties("test.wav")
print "props:", audioProperties

// Read ID_Tag
tagValue = ""
i = 0
while tagValue is not None:

tagValue = dmc.ReadIDTagElementValue("test.wav", i)
print "tag: ", tagValue

if tagValue == "":
break

i += 1

print "Number idTags: ", i



Here's the result:


props: dBpoweramp__ CD (Lossless)ps(0% Compressed)rmat [.wav]
tag:
Number idTags: 0

How can i get the tag information that I can see in windows fine?
Cheers!

Spoon
04-15-2010, 11:35 AM
Try the vb.net example for reading the tags, does that work?

Also you should pass a full path including drive of audio track.