Skip to content

Instantly share code, notes, and snippets.

@yPhil-gh
Created August 11, 2013 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yPhil-gh/6203346 to your computer and use it in GitHub Desktop.
Save yPhil-gh/6203346 to your computer and use it in GitHub Desktop.
Use GST discoverer to expose audio file tags
import pygtk
import gobject
gobject.threads_init()
import pygst
import gst
from gst.extend import discoverer
import gst.pbutils
f = "/home/px/.kituu/scripts/beatnitpycker/Azer0-400-01-Flying_Dutchman.ogg"
newitem = gst.pbutils.Discoverer(50000000000)
info = newitem.discover_uri("file://" + f)
tags = info.get_tags()
for tag_name in tags.keys():
print tag_name, ' = ', tags[tag_name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment