path.py 805 B

1234567891011121314151617181920212223242526272829
  1. import os
  2. def get_relative_output_path(result_dict, *args):
  3. """
  4. Get the relative path to the output directory.
  5. Args:
  6. result_dict (dict): The result dictionary.
  7. *args (str): The path arguments, e.g., "filename.wav".
  8. Returns:
  9. str: The relative path to the output directory.
  10. """
  11. return os.path.join(result_dict["folder_root"], *args)
  12. def get_relative_output_path_ext(result_dict, ext: str):
  13. """
  14. Get the relative path to the output directory with an extension.
  15. Args:
  16. result_dict (dict): The result dictionary.
  17. ext (str): The extension, e.g., ".wav".
  18. Returns:
  19. str: The relative path to the output directory with an extension.
  20. """
  21. return get_relative_output_path(result_dict, result_dict["filename"] + ext)