Skip to content

Commit

Permalink
Preparation for checking the existence of the media file and its size…
Browse files Browse the repository at this point in the history
… (in progress).
  • Loading branch information
FrancoisSchnell committed May 16, 2014
1 parent f25dde5 commit 16fe367
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MediaCours.py
Expand Up @@ -442,6 +442,7 @@ def mediaCheck():
global maxRecordingLength, recording, t0
print "In mediaCheck and duration check"
time.sleep(5) #gives some time for recording thread to begin
checkMediaFile=True
while recording==True:
time.sleep(5) # checking each few seconds
### checking if recording is beyond max recording time
Expand All @@ -453,6 +454,21 @@ def mediaCheck():
text="Enregistrement AVC stoppe car au dessus de la durree maximale."
dialog=wx.MessageDialog(None,message=text,caption="WARNING",style=wx.OK|wx.ICON_INFORMATION)
dialog.ShowModal()
if ( (time.time()-t0 > 30) and (checkMediaFile==True)):
print "checking the existence of a media file"
#if os.path.isfile (workDirectory+"\\"+fileName):
if 0:
text=" Probleme d'enregistrement, media non cree."
dialog=wx.MessageDialog(None,message=text,caption="WARNING",style=wx.OK|wx.ICON_INFORMATION)
dialog.ShowModal()
if 0:
text="L'enregistrement video ou audio semble vide."
dialog=wx.MessageDialog(None,message=text,caption="WARNING",style=wx.OK|wx.ICON_INFORMATION)
dialog.ShowModal()
checkMediaFile=False




def record():
""" Record audio only - mp3 - with pymedia"""
Expand Down

0 comments on commit 16fe367

Please sign in to comment.