RTP Audio System  2.0.0
audioconverter.h File Reference
#include "tdsystem.h"
#include "audioquality.h"

Go to the source code of this file.

Functions

cardinal AudioConverter (const AudioQualityInterface &from, const AudioQualityInterface &to, const card8 *inputBuffer, card8 *outputBuffer, const cardinal inputLength, const cardinal outputLength)
cardinal getAlignedLength (const AudioQualityInterface &inputQuality, const AudioQualityInterface &outputQuality, const cardinal inputLength)
bool getConvParams (const cardinal in, const cardinal out, cardinal &a, cardinal &b, float &c)

Function Documentation

cardinal AudioConverter ( const AudioQualityInterface from,
const AudioQualityInterface to,
const card8 inputBuffer,
card8 outputBuffer,
const cardinal  inputLength,
const cardinal  outputLength 
)

Audio quality converter. Convert quality from a given value to a given value. Note: The "from" value must be greater than or equal to the "to" value, that is from-sampling rate >= to-sampling rate, from-bits >= to-bits, from-channels >= to-channels.

Parameters:
fromQuality to convert from.
toQuality to convert to.
inputBufferInput buffer.
outputBufferOutput buffer.
inputLengthLength of the audio data in input buffer.
outputLengthLength of the output buffer.
Returns:
Length after conversion.
cardinal getAlignedLength ( const AudioQualityInterface inputQuality,
const AudioQualityInterface outputQuality,
const cardinal  inputLength 
)

Get aligned output length for a conversion from given input quality and input length to output quality. Example: 12 Bit/Stereo has a 6-byte alignment: L1L1R1R2 = 48 bits = 6 Bytes.

Parameters:
inputQualityInput quality.
outputQualityOutput quality.
inputLengthInput length.
Returns:
Aligned length.
bool getConvParams ( const cardinal  in,
const cardinal  out,
cardinal a,
cardinal b,
float &  c 
)

Get parameters for audio conversion. New sampling rate = (a * OldSamplingRate) / b;

Parameters:
inOld sampling rate.
outNew sampling rate.
aReference to store a.
bReference to store b.
cReference to store float in / out.
Returns:
true, if a and b have been found; false, if there are no such numbers for b out of the set {1,2,...,20}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines