Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ouch, FoxPro let me down - duration = 0.00000
Message
De
01/01/2018 18:30:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01656859
Message ID:
01656876
Vues:
86
on your question "But when you just let it rip the Duration is 0.00000."
Windows media player must load the media to determine its duration and others properties.As IE it must pass the transitionnings (playstate event)
On Key Label F2 wmp=Null  &&press F2 to  quit wmp

Local  wmp As WindowsMediaPlayer
wmp = Createobject("WMPlayer.OCX.7")
With wmp
  .url=Getfile("mp3|wav")
  .settings.autoStart = .T.
  .settings.Volume=80
  .settings.setMode('loop',.F.)    &&.t. for loop
  .Controls.Play()

  Local m.xdur
  Do While !.currentmedia.duration >0  &&the wmp must pass the transitionnings to work as expected(as IE)
    Inkey(0.1)
  Enddo
  m.xdur=.currentmedia.duration
  _Cliptext=Trans(m.xdur,"999999.99")+"  or  "+.currentmedia.DurationString
  Messagebox("Duration="+Trans(m.xdur,"999999.99")+" sec DurationString="+.currentmedia.DurationString,0+32+4096,'in the clipboard',3000)

Endwith
Inke(m.xdur+0.5)  &&wait until the media is done.can press F2 to exit.note WMP is invisible here.
wmp=Null
Release wmp
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform