def read_reco2vol(volumes_file):
    """Read volume scales for recordings.
    The format of volumes_file is <reco-id> <volume-scale>
    Returns a dictionary { reco-id : volume-scale }
    """
    volumes = {}
    with open(volumes_file) as volume_reader:
        for line in volume_reader.readlines():
            if len(line.strip()) == 0:
                continue

            parts = line.strip().split()
            if len(parts) != 2:
                raise RuntimeError("Unable to parse the line {0} in file {1}."
                                   "".format(line.strip(), volumes_file))
            volumes[parts[0]] = float(parts[1])
    return volumes