rttm

RTTM I/O module.

Classes

RTTMReader

Safe RTTM reader.

RTTMWriter

Safe RTTM writer.

class RTTMReader[source]

Bases: object

Safe RTTM reader.

static check(path)[source]

Checks that a file has of the correct extension and exists.

Parameters:

path (Union[str, Path]) – Path to the file.

Returns:

static read(path, verbose=True)[source]

Reads and parse an RTTM file.

Parameters:
  • path (Union[str, Path]) – Path to the file.

  • verbose (bool) – Verbosity of the method.

Return type:

List[Dict[str, Union[str, float]]]

Returns:

class RTTMWriter[source]

Bases: object

Safe RTTM writer.

static check(path, overwrite=False)[source]

Checks that a file has of the correct extension and verifies that we can overwrite it if it exists.

Parameters:
  • path (Union[str, Path]) – Path to the file.

  • overwrite (bool)

Returns:

static write(segments, path, overwrite=False)[source]

Writes diarized audio segment information in the RTTM format.

Parameters:
  • segments (List[Dict[str, Union[str, float]]]) – Audio segment information.

  • path (Union[str, Path]) – Path to the file.

  • overwrite (bool) – Whether to overwrite, in case of an existing file.

Returns: