Hi guys

I'm new to PyMedia (and kinda new to Python and sound programming too)
so please bare with me.

I'm trying to make a proper visualisation for a PHP Ming MP3 player. At
the moment I first put the MP3 through a PyMedia script to get eight
bands, which then gets picked up by my PHP app and dumped as an array
into ActionScript. 

Now I need to sync up the current time playing (in seconds) in the
ActionScript with the data in the array. Ideally, I'd like to know how
much time each tuple I get out of asBands represents. 

For example, I get 9409 records from a 878sec long MP3 with a bitrate of
238kbps, and 3945 records from a 164sec MP3 with bitrate of 192kbps. So
for the first MP3 I'm getting about 10.7 records per second, and for the
second I'm getting about 24 records per second.

The script for outputting the data is pretty much:
filename = sys.argv[1]
f = open(filename, 'rb')
s=f.read()
spa = pymedia.audio.sound.SpectrAnalyzer(1, 500, 256)
bands= spa.asBands(8, s)
for band in bands:
        print band

Thanks!
Jason


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Pymedia-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pymedia-users

Reply via email to