---
name: "ost_AudioBase"
section: "3"
platform: "linux"
package: "libccaudio2-doc"
version: "1.0.0-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ost_AudioBase"
---

# ost\_AudioBase(3)

AudioBase base class for many other audio classes which stream data.

## NAME

ost::AudioBase - **AudioBase** base class for many other audio classes which stream data.

## SYNOPSIS

`#include <audio2.h>`

Inherits **ost::Audio**.

Inherited by **ost::AudioBuffer**, **ost::AudioDevice**, and **ost::AudioFile**.

### Public Member Functions

**AudioBase** ()\
 *Create audio base object with no info.*  **AudioBase** (Info \***info**)\
 *Create audio base object with audio source description.*  virtual **~AudioBase** ()\
 *Destroy an audio base object.*  **Encoding** **getEncoding** (void)\
 *Generic get encoding.*  unsigned **getSampleRate** (void)\
 *Generic sample rate.*  virtual ssize\_t **putBuffer** (**Encoded** data, size\_t size)=0\
 *Abstract interface to put raw data.*  ssize\_t **putNative** (**Encoded** data, size\_t size)\
 *Puts raw data and does native to refined endian swapping if needed based on encoding type and local machine endian.*  virtual ssize\_t **getBuffer** (**Encoded** data, size\_t size)=0\
 *Abstract interface to get raw data.*  ssize\_t **getPacket** (**Encoded** data)\
 *Get's a packet of audio data.*  ssize\_t **getNative** (**Encoded** data, size\_t size)\
 *Get raw data and assure is in native machine endian.*

### Protected Attributes

Info **info**\

## Detailed Description

**AudioBase** base class for many other audio classes which stream data.

common audio stream base.

## Constructor & Destructor Documentation

### ost::AudioBase::AudioBase ()

Create audio base object with no info.

### ost::AudioBase::AudioBase (Info \* info)

Create audio base object with audio source description.

**Parameters:**

*info* source description.

### virtual ost::AudioBase::~AudioBase ()` [virtual]`

Destroy an audio base object.

## Member Function Documentation

### Encoding ost::AudioBase::getEncoding (void)` [inline]`

Generic get encoding.

**Returns:**

audio encoding of this object.

Reimplemented in **ost::AudioFile**.

### unsigned ost::AudioBase::getSampleRate (void)` [inline]`

Generic sample rate.

**Returns:**

audio sample rate of this object.

Reimplemented in **ost::AudioFile**.

### virtual ssize\_t ost::AudioBase::putBuffer (Encoded data, size\_t size)` [pure virtual]`

Abstract interface to put raw data.

**Parameters:**

*data* to put. \
 *size* of data to put.

**Returns:**

number of bytes actually put.

Implemented in **ost::AudioBuffer**, **ost::AudioFile**, and **ost::AudioDevice**.

### ssize\_t ost::AudioBase::putNative (Encoded data, size\_t size)

Puts raw data and does native to refined endian swapping if needed based on encoding type and local machine endian.

**Parameters:**

*data* to put. \
 *size* of data to put.

**Returns:**

number of bytes actually put.

### virtual ssize\_t ost::AudioBase::getBuffer (Encoded data, size\_t size)` [pure virtual]`

Abstract interface to get raw data.

**Returns:**

data received in buffer.

**Parameters:**

*data* to get. \
 *size* of data to get.

Implemented in **ost::AudioBuffer**, **ost::AudioFile**, **ost::AudioStream**, and **ost::AudioDevice**.

### ssize\_t ost::AudioBase::getPacket (Encoded data)` [inline]`

Get's a packet of audio data.

**Returns:**

count of data received.

**Parameters:**

*data* to get.

Reimplemented in **ost::AudioStream**.

### ssize\_t ost::AudioBase::getNative (Encoded data, size\_t size)

Get raw data and assure is in native machine endian.

**Returns:**

data received in buffer.

**Parameters:**

*data* to get. \
 *size* of data to get.

## Member Data Documentation

### Info ost::AudioBase::info` [protected]`

## Author

Generated automatically by Doxygen for ccAudio from the source code.
