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

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

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

# AudioProcessor

[common]\
class [AudioProcessor](index.md)

A configuration-driven audio feature processor: a waveform in, the raw waveform, a log-mel spectrogram or a log-mel filterbank out, as a model's `preprocessor_config.json` states it. A file or payload is decoded, resampled to the configured rate and mixed to mono first; a waveform you hand in must already be at that rate. `AutoCloseable`: [close](close.md) releases it.

## Types

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

## Functions

| Name | Summary |
|---|---|
| [close](close.md) | [common]<br>open fun [close](close.md)() |
| [process](process.md) | [common]<br>fun [process](process.md)(bytes: [ByteArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html), options: [AudioProcessOptions](../AudioProcessOptions/index.md)? = null, where: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>Decode an encoded audio payload and compute its features.<br>[common]<br>fun [process](process.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), options: [AudioProcessOptions](../AudioProcessOptions/index.md)? = null, where: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>Decode an audio file and compute its features.<br>[common]<br>fun [process](process.md)(waveform: [Tensor](../Tensor/index.md), sampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), options: [AudioProcessOptions](../AudioProcessOptions/index.md)? = null, where: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>Features of a decoded mono waveform tensor (`[N]` or `[1, N]` Float32) at [sampleRate](process.md).<br>[common]<br>fun [process](process.md)(waveform: [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html), sampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), options: [AudioProcessOptions](../AudioProcessOptions/index.md)? = null, where: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>Features of a decoded mono waveform at [sampleRate](process.md), which must equal the configured rate. |