def guess_fileformat(filename):
    """
    Guess the format of a sound file.
    """
    try:
        return filename.split('.')[-1]
    except IndexError:
        raise ValueError('unknown file format')
