[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to find play length of .ogg file using python?



I am writing a program using pygame to play musical sound cues. I need a way to determine the play length of a sound file. I can get the length of .mp3 files with python-pymad. I have also installed python-pyogg and python-pyvorbis. It seems that I should be able to get the length of .ogg files with one of these packages, but the documentation and examples do not show how.

I have googled for these packages and basically have found that documentation does not seem to exist, yet. It was suggesated to check the docs for libvorbis, but I haven't been able to find this, either.

The output of VorbisFile.info() seems to be an object with various attributes, probably including the play length, but the only attributes shown in the example are channels and rate. The module is a .so file, so I can not look at python source to determine the other attributes and I would rather not have to download C source code and plow through that. Is there a list of the attributes for this object, somewhere?

Can anyone give me an easy way to find the play length of an .ogg file, or point me to where the documentation exists.

TIA

--
Marc Shapiro

No boom today. Boom tomorrow. There's always a boom tomorrow.
What?! Look, somebody's got to have some damn perspective around here.
Boom. Sooner or later ... boom!

- Susan Ivanova: B5 - Grail



Reply to: