[ASR] Support audio_filepath as a list of single-channel files
State: closed | Pull request: yes
Labels: name: ASR

name: common

# What does this PR do ?

Currently, multichannel audio can be used in `audio_filepath` by providing a path to a multichannel file.
This PR adds support for `audio_path` to specify multichannel audio by providing a list of paths to single-channel files.

**Collection**: ASR

# Changelog 

- `AudioSegment.from_file` can load multichannel audio from a list of paths to single-channel audio files
- `manifest.get_full_path` supports lists as input and can resolve path to each path in a list
- Added unit tests for `AudioSegment`
	- `TestAudioSegment:: test_audio_segment_from_file` for existing functionality, loading a single file
	- `TestAudioSegment:: test_audio_segment_multichannel_with_list ` for new functionality, loading multiple single-channel files
- Added unit tests for `manifest.get_full_path`
	- `TestPreprocessingUtils:: test_get_full_path_local` when resolving local paths, both single paths and lists
	- `TestPreprocessingUtils:: test_get_full_path_ais` when resolving paths pointing to AIStore, both single paths and lists

# Usage

## Example scripts
- [examples.zip](https://github.com/NVIDIA/NeMo/files/10887310/examples.zip)

## Description

Currently, ASR models can be used to transcribe multichannel audio by providing a path to a multichannel audio file in `audio_filepath` and selecting a single channel using `channel_selector`.
This PR adds an option to set `audio_filepath` to a list of paths to individual channels, each containing a single channel. This is useful in situations where multichannel audio is provided as individual channels.

Two examples with `audio_filepath` containing a list of paths to single-channel files are provided below.
The first example is directly using `transcribe()` od an `ASRModel`. The second example is running `speech_to_text_eval.py`.

### Example 1

This example will check if `asr_model.transcribe` is working the same when a path to multichannel audio is provided as

- a path to a multichannel audio file (this is currently supported)
- a list of paths to single-channel audio files (added in this PR)

In both cases, channel_selector can be used to pick one channel from the input multichannel audio.

The test will run with two different models: `stt_en_conformer_ctc_small` and `stt_en_conformer_transducer_small` and each of the 3 available channels.

To run the test:

```
python test_asr_model_transcribe.py
```

### Example 2

This example will check if `speech_to_text_eval.py` is working the same when a path to multichannel audio is provided as

- a path to a multichannel audio file (this is currently supported)
- a list of paths to single-channel audio files (added in this PR)

In both cases, channel_selector can be used to pick one channel from the input multichannel audio.

The test will run with two different models: `stt_en_conformer_ctc_small` and `stt_en_conformer_transducer_small` and each of the 3 available channels.

To run the test:

```
python test_speech_to_text_eval.py --nemo-dir PATH_TO_NEMO_DIR
```

# Before your PR is "Ready for review"
**Pre checks**:
- [x] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [x] Did you write any new necessary tests?
- [ ] Did you add or update any necessary documentation?
- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
  - [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
  
**PR Type**:
- [x] New Feature
- [ ] Bugfix
- [ ] Documentation

If you haven't finished some of the above items you can still open "Draft" PR.


## Who can review?

Anyone in the community is free to review the PR once the checks have passed. 
[Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.

# Additional Information
* Related to # (issue)