def wav_to_Sound(wav, sr: int) -> parselmouth.Sound:
    """Convert a waveform to a parselmouth.Sound object

    Args:
        wav (np.ndarray/torch.Tensor): waveform of shape (n_channels, n_samples)
        sr (int, optional): sampling rate.

    Returns:
        parselmouth.Sound: a parselmouth.Sound object
    """
    assert wav.shape == (1, len(wav[0])), "wav must be of shape (1, n_samples)"
    sound = None
    if isinstance(wav, np.ndarray):
        sound = parselmouth.Sound(wav[0], sampling_frequency=sr)
    elif isinstance(wav, torch.Tensor):
        sound = parselmouth.Sound(wav[0].numpy(), sampling_frequency=sr)
    assert sound is not None, "wav must be either np.ndarray or torch.Tensor"
    return sound
Convert a waveform to a parselmouth.Sound object

Args:
wav (np.ndarray/torch.Tensor): waveform of shape (n_channels, n_samples)
sr (int, optional): sampling rate.

Returns:
parselmouth.Sound: a parselmouth.Sound object
processors/data_augment.py