wavaug module¶
This module does multichannel audio flies augmentation.
- wavaug.amp_args_validation(amplitude_list_str) str¶
Function make external check of args for option dly.
- wavaug.amplitude_hdr(args)¶
Function makes CLI amplitude augmentation.
- wavaug.augmentate(args)¶
Augments the input audio file based on the provided arguments.
- Parameters:
args (argparse.Namespace) – The command line arguments.
- Returns:
None
- Raises:
None –
This function performs the following steps:
Calls the chain_hdr function to process the chain code from the arguments and execute the corresponding WaChain commands.
Calls the input_path_hdr function to validate the input path.
Calls the file_info_hdr function to retrieve information about the input file.
Calls the output_path_hdr function to validate the output path.
Calls the amplitude_hdr function to perform amplitude augmentation on the input file.
Calls the noise_hdr function to perform noise augmentation on the input file.
Calls the delay_hdr function to perform time delay augmentation on the input file.
Calls the echo_hdr function to perform echo augmentation on the input file.
Note: This function does not return any value. It is expected to be called from the main function of the program.
- wavaug.chain_hdr(args)¶
Processes the chain code from the given arguments and executes the corresponding WaChain commands.
- Parameters:
args – The arguments containing the chain code to be executed.
- Returns:
None
- Raises:
SystemExit – Exits the program with a status code of 0 after
successful execution. –
- wavaug.delay_args_validation(delay_list_str) str¶
Function make external check of args for option dly.
- wavaug.delay_hdr(args)¶
Function makes CLI delay augmentation.
- wavaug.echo_args_validation(echo_list) str¶
Function make external check of args for option echo.
- wavaug.echo_hdr(args)¶
Function makes CLI echo augmentation.
- wavaug.file_info(path: str) dict¶
Returns a dictionary containing information about a WAV file.
- Parameters:
path (str) – The path to the WAV file.
- Returns:
- A dictionary containing the following keys:
path (str): The path to the WAV file.
channels_count (int): The number of channels in the WAV file.
sample_rate (int): The sample rate of the WAV file.
length_s (float): The length of the WAV file in seconds.
- Return type:
dict
- wavaug.file_info_hdr(args)¶
Function prints info about input audio file.
- wavaug.input_path_validation(in_path) str¶
Function checks presence of input file
- wavaug.is_file_creatable(fullpath: str) bool¶
Checks if a file can be created at the given full path.
- Parameters:
fullpath (str) – The full path where the file is to be created.
- Returns:
True if the file can be created, False otherwise.
- Return type:
bool
- Raises:
Exception – If the file cannot be created.
SystemExit – If the path does not exist.
- wavaug.main()¶
CLI arguments parsing.
- wavaug.noise_args_validation(noise_list_str) str¶
Function make external check of args for option noise.
- wavaug.noise_hdr(args)¶
Function makes CLI noise augmentation.
- wavaug.output_path_validation(out_path)¶
Function checks of output file name and path.
- wavaug.parse_args()¶
CLI options parsing.
- wavaug.print_help_and_info()¶
Function prints info about application
- wavaug.validate_amp_list(amplitude_list: List[str]) None¶
Checks if all elements in the given amplitudes list are valid numbers.
- Parameters:
amplitude_list (list[str]) – The list of elements to check.
- Returns:
None
- Raises:
ValueError – If the list contains a non-number element.
SystemExit – Exits the program with a status code of 3 if a non-number
element is found. –
- wavaug.validate_delay_list(delays_list: List[str]) None¶
Checks if all elements in the given delays list are valid integers.
- Parameters:
delays_list (list[str]) – The list of elements to check.
- Returns:
None
- Raises:
ValueError – If the list contains a non-integer element.
SystemExit – Exits the program with a status code of 1 if a non-integer
element is found. –