man Audio (Fonctions bibliothèques) - Generic audio class to hold master data types and various useful class encapsulated friend functions as per GNU Common C++ 2 coding standard. Master audio class.

NAME

Audio - Generic audio class to hold master data types and various useful class encapsulated friend functions as per GNU Common C++ 2 coding standard. Master audio class.

SYNOPSIS



#include <audio.h>

Inherited by AudioCodec, AudioFile, AudioSample, and CDAudio.

Static Public Methods

int getFrame (Encoding encoding, int samples=0)

Returns the number of bytes in a sample frame for the given encoding type, rounded up to the nearest integer. int getCount (Encoding encoding)

Returns the number of samples in all channels for a frame in the given encoding.

DETAILED DESCRIPTION

Generic audio class to hold master data types and various useful class encapsulated friend functions as per GNU Common C++ 2 coding standard. Master audio class.

Author: David Sugar <dyfet@ostel.com>

MEMBER FUNCTION DOCUMENTATION

int Audio::getCount (Encoding encoding) [static]

Returns the number of samples in all channels for a frame in the given encoding.

For example, pcm32Stereo has a frame size of 8 bytes: Note that different codecs have different definitions of a frame - for example, compressed encodings have a rather large frame size relative to the sample size due to the way bytes are fed to the decompression engine.

Parameters:

encoding
The encoding to calculate the frame sample count for.

Returns: samples The number of samples in a frame of the given encoding.

int Audio::getFrame (Encoding encoding, int samples = 0) [static]

Returns the number of bytes in a sample frame for the given encoding type, rounded up to the nearest integer.

A frame is defined as the minimum number of bytes necessary to create a point or points in the output waveform for all output channels. For example, 16-bit mono PCM has a frame size of two (because those two bytes constitute a point in the output waveform). GSM has it's own definition of a frame which involves decompressing a sequence of bytes to determine the final points on the output waveform. The minimum number of bytes you can feed to the decompression engine is 32.5 (260 bits), so this function will return 33 (because we round up) given an encoding type of GSM. Other compressed encodings will return similar results. Be prepared to deal with nonintuitive return values for rare encodings.

Parameters:

encoding
The encoding type to get the frame size for.
samples
Reserved. Use zero.

Returns: The number of bytes in a frame for the given encoding.

AUTHOR

Generated automatically by Doxygen for ccAudio from the source code.