diff --git a/pyannote/core/annotation.py b/pyannote/core/annotation.py index b342144..0028109 100755 --- a/pyannote/core/annotation.py +++ b/pyannote/core/annotation.py @@ -391,10 +391,16 @@ def write_rttm(self, file: TextIO): f'containing spaces (got: "{label}").' ) raise ValueError(msg) - line = ( - f"SPEAKER {uri} 1 {segment.start:.3f} {segment.duration:.3f} " - f" {label} \n" - ) + if label not in ['noise', 'music', 'other']: + line = ( + f"SPEAKER {uri} 1 {segment.start:.3f} {segment.duration:.3f} " + f" {label} \n" + ) + else: + line = ( + f"NON-SPEECH {uri} 1 {segment.start:.3f} {segment.duration:.3f} " + f" {label} \n" + ) file.write(line) def crop(self, support: Support, mode: CropMode = "intersection") -> "Annotation":