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

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

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

# saveAudio

[common]\
fun [saveAudio](saveAudio.md)(samples: [Tensor](../Tensor/index.md), sampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))

Write a waveform as a 16-bit PCM WAV file at [path](saveAudio.md); the bytes are exactly [encodeAudio](encodeAudio.md)'s. A name asking for another container (`.mp3`, `.ogg`, `.flac`, ...) is refused (`UNSUPPORTED`) with nothing written.