---
name: "AudioCodec"
section: "3cc"
platform: "linux"
package: "libccaudio-dev"
version: "1.2.0-1+b1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/AudioCodec/3cc"
---

# AudioCodec(3cc)

The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded 'sample' buffer.process codec interface.

## NAME

AudioCodec - The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded 'sample' buffer.process codec interface.

## SYNOPSIS

`#include <audio.h>`

Inherits **Audio**.

### Public Member Functions

**AudioCodec** (const char \*n, Encoding e)\
 virtual unsigned **encode** (Linear buffer, void \*dest, unsigned lsamples)=0\
 *Encode a linear sample frame into the codec sample buffer.*  virtual unsigned **decode** (Linear buffer, void \*source, unsigned lsamples)=0\
 *Decode the sample frame into linear samples.*

### Static Public Member Functions

static **AudioCodec** \* **getCodec** (Encoding encoding, const char \*name=NULL)\
 static bool **load** (const char \*name)\

### Protected Attributes

**AudioCodec** \* **next**\
 Encoding **encoding**\
 const char \* **name**\

### Static Protected Attributes

static Mutex **lock**\
 static **AudioCodec** \* **first**\

## Detailed Description

The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded 'sample' buffer.process codec interface.

This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with **AudioSample**. A derived AudioCodecXXX will typically include a AudioRegisterXXX static class to automatically initialize and register the codec with the codec registry.

**Author:**

David Sugar \<dyfet@ostel.com\>

## Member Function Documentation

### virtual unsigned AudioCodec::decode (Linear buffer, void \* source, unsigned lsamples)` [pure virtual]`

Decode the sample frame into linear samples.

**Returns:**

number of bytes scanned.

**Parameters:**

*buffer* sample buffer to save linear samples into. \
 *source* for encoded data. \
 *number* of samples to extract.

### virtual unsigned AudioCodec::encode (Linear buffer, void \* dest, unsigned lsamples)` [pure virtual]`

Encode a linear sample frame into the codec sample buffer.

**Parameters:**

*number* of bytes written. \
 *buffer* linear sample buffer to use. \
 *dest* buffer to store encoded results. \
 *lsamples* The number of linear samples.

## Author

Generated automatically by Doxygen for ccAudio from the source code.
