I would like to extract the .rttm file for an input .wav audio file in python
def extract_rttm_file(wav_path):
"""Extracts the .rttm file from the converted wav file.
Args:
wav_path: The path to the converted wav file.
Returns:
The path to the .rttm file.
"""
output_path = os.path.splitext(wav_path)[0] + ".rttm"
subprocess.call(["sox", wav_path, "-rttm", output_path])
return output_path`
I tried the above code but it doesn't ouput the rttm file
You can use pyanote-audio to do speaker diarization in python. See the speaker-diarization model on huggingface for more info.
Example: