def duration(input_filepath):
validate_input_file(input_filepath)<EOL>output = soxi(input_filepath, '<STR_LIT:D>')<EOL>if output == '<STR_LIT:0>':<EOL><INDENT>logger.warning("<STR_LIT>", input_filepath)<EOL><DEDENT>return float(output)<EOL>
Show duration in seconds (0 if unavailable).

Parameters
----------
input_filepath : str
    Path to audio file.

Returns
-------
duration : float
    Duration of audio file in seconds.
    If unavailable or empty, returns 0.