proc getLen*(filepath: string): int =
      const command = """expr $(mediainfo --Inform="Audio;%Duration%" """
      return execProcess(command & """"""" & filepath & """") / 
1000""").parseInt
    

I'm executing this command in bash and getting result "347": 
    
    
    expr $(mediainfo --Inform="Audio;%Duration%" "mytrack.ogg") / 1000
    
    

Error is: 
    
    
    Traceback (most recent call last)
    do.nim(45)               do
    do.nim(33)               getLen
    strutils.nim             parseInt
    Error: unhandled exception: invalid integer: 347
     [ValueError]
    
    

Nim Compiler Version 0.14.3 (2016-08-07) [Linux: amd64] Ubuntu 15.10

Reply via email to