pub fn get_audio_dir(
cli_audio: Option<String>,
config: &Config,
) -> Result<PathBuf>Expand description
Retrieves the audio directory from various sources.
This function determines the audio directory based on the provided input, checking in the following order: CLI argument, environment variable, and configuration file. If no audio directory is found, it defaults to the current directory.
§Parameters
cli_audio: Optional audio directory provided via the command line.config: Configuration containing fallback audio directory information.
§Returns
Result<PathBuf>: The resolved audio directory path, or an error if resolution fails.
§Notes
- Prioritizes CLI argument over environment variable and configuration file.
- Defaults to the current directory if no other audio directory is found.