parameters: (audio_raw_filename)
return_statement: return float(idl[0])
docstring: This attempts to get the length of the media file (length is time in seconds).
      This should not be confused with size (in bytes) of the file data.
      This is best used on a raw PCM AUDIO file because mplayer cannot get an accurate
      time for many compressed video and audio formats -- notably MPEG4 and MP3.
      Weird...
      This returns -1 if it cannot get the length of the given file.
docstring_summary: This attempts to get the length of the media file (length is time in seconds).
      This should not be confused with size (in bytes) of the file data.
      This is best used on a raw PCM AUDIO file because mplayer cannot get an accurate
      time for many compressed video and audio formats -- notably MPEG4 and MP3.
      Weird...
      This returns -1 if it cannot get the length of the given file.
docstring_tokens: This attempts to get the length of the media file ( length is time in seconds ) . This should not be confused with size ( in bytes ) of the file data . This is best used on a raw PCM AUDIO file because mplayer cannot get an accurate time for many compressed video and audio formats -- notably MPEG4 and MP3 . Weird ... This returns - 1 if it cannot get the length of the given file .
function: def get_length(audio_raw_filename):
      """This attempts to get the length of the media file (length is time in seconds).
      This should not be confused with size (in bytes) of the file data.
      This is best used on a raw PCM AUDIO file because mplayer cannot get an accurate
      time for many compressed video and audio formats -- notably MPEG4 and MP3.
      Weird...
      This returns -1 if it cannot get the length of the given file.
      """
      cmd = "mplayer %s -vo null -ao null -frames 0 -identify" % audio_raw_filename
      (command_output, exitstatus) = run(cmd)
      idl = sorted(re.findall("ID_LENGTH=([0-9.]*)", command_output))
      if len(idl) != 1:
          print "ERROR: cannot get length of raw audio file."
          print "command_output of mplayer identify:"
          print command_output
          print "parsed command_output:"
          print str(idl)
          return -1
      return float(idl[0])
function_tokens: def get_length ( audio_raw_filename ) : cmd = "mplayer %s -vo null -ao null -frames 0 -identify" % audio_raw_filename ( command_output , exitstatus ) = run ( cmd ) idl = sorted ( re . findall ( "ID_LENGTH=([0-9.]*)" , command_output ) ) if len ( idl ) != 1 : print "ERROR: cannot get length of raw audio file." print "command_output of mplayer identify:" print command_output print "parsed command_output:" print str ( idl ) return - 1 return float ( idl [ 0 ] )