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

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

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

# peekAudio

[common]\
fun [peekAudio](peekAudio.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), targetSampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, targetChannels: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0): [AudioInfo](../AudioInfo/index.md)

Read an audio header from a file. [targetSampleRate](peekAudio.md) and [targetChannels](peekAudio.md) of 0 report the file's own values; a non-zero value reports the effective figures after the resample or downmix a decode applies.

[common]\
fun [peekAudio](peekAudio.md)(bytes: [ByteArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html), targetSampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, targetChannels: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0): [AudioInfo](../AudioInfo/index.md)

Read an audio header from an encoded payload in memory; the same targets as the file form.