---
title: "DiarizationModel"
sidebar_label: "DiarizationModel"
description: "Kotlin binding reference: DiarizationModel."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[DiarizationModel](index.md)

# DiarizationModel

[common]\
class [DiarizationModel](index.md) : [PreTrainedModel](../PreTrainedModel/index.md)

A speaker-diarization model: a clip in, who spoke when out, as [SpeakerSegment](../SpeakerSegment/index.md)s in time order (the `voice-activity-detection` kind).

Open it with [open](Companion/open.md) from a checkpoint the model library's diarization families claim (a family that declares who-spoke-when out of audio under the `voice-activity-detection` tag). Hand it a clip as 16-bit PCM with [diarize](diarize.md); the segments arrive through the listener on the model's own worker thread, one clip at a time per model. [close](close.md) frees the weights.

## Types

| Name | Summary |
|---|---|
| [Companion](Companion/index.md) | [common]<br>object [Companion](Companion/index.md) |

## Properties

| Name | Summary |
|---|---|
| [capabilities](capabilities.md) | [common]<br>val [capabilities](capabilities.md): [Capabilities](../Capabilities/index.md)<br>What the model takes and gives, read when it opened. |
| [config](config.md) | [common]<br>open override val [config](config.md): [PretrainedConfig](../PretrainedConfig/index.md)<br>The checkpoint's identity, read when the model opened. |

## Functions

| Name | Summary |
|---|---|
| [close](close.md) | [common]<br>open fun [close](close.md)()<br>Free the model. A running request is canceled first and the call waits for it to return; called from inside a listener callback, the free runs right after that callback's request ends instead. Idempotent. |
| [diarize](diarize.md) | [common]<br>fun [diarize](diarize.md)(pcm16: [ShortArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-short-array/index.html), sampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), options: [DiarizeOptions](../DiarizeOptions/index.md) = DiarizeOptions(), listener: [DiarizeListener](../DiarizeListener/index.md)): [DiarizeHandle](../DiarizeHandle/index.md)<br>Diarize [pcm16](diarize.md), mono 16-bit samples at [sampleRate](diarize.md) hertz (the clip is resampled to the model's 16 kHz), under [options](diarize.md). Returns at once; the worker runs the request and calls [listener](diarize.md) on its thread: [DiarizeListener.onSegments](../DiarizeListener/onSegments.md) with the segments in time order, then [DiarizeListener.onDone](../DiarizeListener/onDone.md) with the [DiarizeReport](../DiarizeReport/index.md). |
| [residency](residency.md) | [common]<br>open override fun [residency](residency.md)(): [ResidencyReport](../ResidencyReport/index.md)<br>What the model holds on each device right now ([ResidencyReport](../ResidencyReport/index.md)); a closed model refuses with [ModelverseException](../ModelverseException/index.md). |