> ## Documentation Index
> Fetch the complete documentation index at: https://baileys.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# getAudioDuration

> Function getAudioDuration in the Baileys API.

> **getAudioDuration**(`buffer`): `Promise`\<`undefined` | `number`>

Defined in: [src/Utils/messages-media.ts:224](https://github.com/WhiskeySockets/Baileys/blob/master/src/Utils/messages-media.ts#L224)

## Parameters

### buffer

`string` | `Buffer`\<`ArrayBufferLike`> | `Readable`

## Returns

`Promise`\<`undefined` | `number`>
