Spaces:
Running
Running
| # Copyright (c) Facebook, Inc. and its affiliates. | |
| # | |
| # This source code is licensed under the MIT license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| from typing import List, Tuple | |
| def get_audio_files(manifest_path: str) -> Tuple[str, List[str], List[int]]: | |
| fnames, sizes = [], [] | |
| with open(manifest_path, "r") as f: | |
| root_dir = f.readline().strip() | |
| for line in f: | |
| items = line.strip().split("\t") | |
| assert ( | |
| len(items) == 2 | |
| ), f"File must have two columns separated by tab. Got {line}" | |
| fnames.append(items[0]) | |
| sizes.append(int(items[1])) | |
| return root_dir, fnames, sizes | |