Play MP3s from Windows

Arlie arlie.c at
Fri Jun 19 20:57:01 EDT 2009

On Jun 20, 8:07 am, Tim Harig <user... at> wrote:
> On 2009-06-19, Arlie <arli... at> wrote:
> > print 'Duree du fichier : ',buf,' millisecondes'
> You can obviously make sure that 'buf' can be accessed as a string.
> > time.sleep(int(buf)/1000)
> The error seems to be having issues converting buf to an int.  Could you
> possibly convert it to a string before converting it to an int?
> time.sleep(int(str(buf))/1000)

I'm still getting same error. So I just did this:


mci.directsend('open "d:\\Linger.mp3" alias toto')
mci.directsend('set toto time format milliseconds')
err,buf=mci.directsend('status toto length ')
print 'Duree du fichier : ',buf,' millisecondes'
soundlength = int(buf) / 1000
err,buf=mci.directsend('play toto from 0 to '+str(buf))
mci.directsend('close toto')

More information about the Python-list mailing list