# `RTMP.FLV.AudioTag`
[🔗](https://github.com/Adeyeye93/rtmp/blob/v0.1.0/lib/rtmp/flv/audio_tag.ex#L1)

Parses the body of an RTMP audio message (an FLV audio tag body).

AAC is parsed: the sequence header's AudioSpecificConfig is decoded into
`%{object_type: ..., sample_rate: ..., channels: ...}` and raw frames are
delivered as-is. Every other legacy FLV sound format (MP3, Speex, PCM,
Nellymoser, G.711, ...) is passed through unparsed, with the FLV header's
rate/size/channel fields in `:config`.

Enhanced RTMP audio (sound format 9, the "ExHeader" used for Opus, FLAC,
AC-3 and multitrack audio) is not supported and is reported as
`{:unsupported, reason}` so the connection can reject it cleanly instead
of handing out frames nobody can decode.

# `result`

```elixir
@type result() :: {:ok, map()} | :skip | {:error, term()} | {:unsupported, term()}
```

# `parse`

```elixir
@spec parse(binary()) :: result()
```

Parses an audio message payload into `RTMP.Frame` fields.

Returns `{:ok, fields}`, `:skip` (an empty message — nothing to deliver),
`{:error, reason}` (malformed; drop this frame), or
`{:unsupported, reason}` (a codec this library rejects).

# `parse_audio_specific_config`

```elixir
@spec parse_audio_specific_config(binary()) :: {:ok, map()} | {:error, term()}
```

Decodes an AAC AudioSpecificConfig (ISO 14496-3, 1.6.2.1).

Returns `%{object_type: integer, sample_rate: integer, channels: integer}`.
`channels` is the raw channel configuration; `0` means the layout is
defined in a program config element.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
