class AudioClient

Audio Client. More...

Full nameCoral::AudioClient
Definition#include <audioclient.h>
InheritsCoral::AdjustableAudioQualityInterface [virtual public]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

This class is an audio client.

 AudioClient (AudioWriterInterface* audioOutput, const char* receiverName)

Constructor for a new audio client.

Parameters:
audioOutputAudioWriter to write the output to.
receiverNameString with the receiver name or NULL for default.

AudioClient ()

Destructor.

bool  play (const char* server, const char* mediaName)

Start playing given media from given server.

Parameters:
serverServer address (e.g. gaffel:7500).
mediaNameMedia name (e.g. ../AudioFiles/Test1.list)

Returns: true, if play request has been sent to server.

void  change (const char* mediaName)

Change media of an established connection.

Parameters:
mediaNameNew media name (e.g. ../AudioFiles/Test2.list)

void  stop ()

Stop playing.

card64  getPosition ()

Get current media position. This will automatically the RestartPosition value in the next AudioClientAppPacket. The server will restart from the current position, if the server is restarted.

Returns: Position in nanoseconds.

inline card64  getMaxPosition ()

[const]

Get maximum media position.

Returns: Maximum position in nanoseconds.

card16  getSamplingRate ()

[const]

getSamplingRate() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

card8  getBits ()

[const]

getBits() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

card8  getChannels ()

[const]

getChannels() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

card16  getByteOrder ()

[const]

getByteOrder() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

cardinal  getBytesPerSecond ()

[const]

getBytesPerSecond() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

cardinal  getBitsPerSample ()

[const]

getBitsPerSample() Implementation of AudioQualityInterface.

Reimplemented from AudioQualityInterface.

cardinal  getRawBytesPerSecond ()

Get number of raw bytes (incl. IPv6/UDP/RTP/RTPAudio headers) per second.

Returns: Number of raw bytes per second.

TransportInfo  getTransportInfo (const bool calculateLevels = true)

Get TransportInfo for current setting.

Parameters:
calculateLevelstrue to calculate all level constants; false otherwise.

Returns: TransportInfo.

MediaInfo  getMediaInfo ()

[const]

Get MediaInfo.

Returns: MediaInfo.

inline card8  getErrorCode ()

[const]

Get error code.

Returns: Error code.

inline const char*  getEncoding ()

[const]

Get encoding name.

Returns: Encoding name.

inline card32  getBandwidthLimit ()

[const]

Get bandwidth limit.

Returns: Bandwidth limit.

card8  getIPVersion ()

[const]

Get IP version.

Returns: IP Version.

inline bool  playing ()

[const]

Check, if audio client is playing.

Returns: true, if client is playing; false otherwise.

String  getServerAddressString (InternetAddress::PrintFormat format = InternetAddress::PF_Address)

[const]

Get server address string.

Parameters:
formatPrint format.

Returns: Server address.

String  getOurAddressString (InternetAddress::PrintFormat format = InternetAddress::PF_Address)

[const]

Get client address string.

Parameters:
formatPrint format.

Returns: Client address.

inline cardinal  getLayers ()

[const]

Get number of layers in last transmission.

inline card64  getBytesReceived (const cardinal layer = 0)

[const]

Get number of bytes received.

Parameters:
layerLayer number or (cardinal)-1 for sum of all layers.

Returns: Number of bytes received

inline card64  getPacketsReceived (const cardinal layer = 0)

[const]

Get number of packets received in given layer.

Parameters:
layerLayer number or (cardinal)-1 for sum of all layers.

Returns: Number of packets received

inline InternetFlow  getInternetFlow (const cardinal layer = 0)

[const]

Get InternetFlow of last received packet in given layer.

Parameters:
layerLayer number.

Returns: InternetFlow.

inline card32  getFlowLabel (const cardinal layer = 0)

[const]

Get flow label of last received packet in given layer.

Parameters:
layerLayer number.

Returns: Flow label.

inline card8  getTrafficClass (const cardinal layer = 0)

[const]

Get traffic class of last received packet in given layer.

Parameters:
layerLayer number.

Returns: Traffic class.

card32  getServerSSRC (const cardinal layer = 0)

[const]

Get server SSRC for given layer.

Parameters:
layerLayer number.

Returns: Server SSRC.

inline card32  getOurSSRC ()

[const]

Get client SSRC.

Returns: Client SSRC.

card64  getPacketsLost (const cardinal layer = 0)

[const]

Get number of packets lost for given layer.

Parameters:
layerLayer number.

Returns: Number of packets lost.

double  getFractionLost (const cardinal layer = 0)

[const]

Get fraction of packets lost for given layer.

Parameters:
layerLayer number.

Returns: Fraction of packets lost.

double  getJitter (const cardinal layer = 0)

[const]

Get jitter for given layer.

Parameters:
layerLayer number.

Returns: Jitter.

const char*  getEncodingName (const cardinal index)

Get encoding name for a given index of the client's decoder repository.

Parameters:
indexRepository index.

Returns: Encoding name or NULL, if index is too high.

inline void  setPosition (const card64 position)

Set media position.

Parameters:
positionNew media position in nanoseconds.

void  setPause (const bool on)

Set pause.

Parameters:
ontrue for pause on; false for pause off.

card16  setSamplingRate (const card16 rate)

Set audio sampling rate.

Parameters:
rateNew audio sampling rate.

Reimplemented from AdjustableAudioQualityInterface.

card8  setChannels (const card8 channels)

Set number of audio channels

Parameters:
channelsNew number of audio channels.

Reimplemented from AdjustableAudioQualityInterface.

card8  setBits (const card8 bits)

Set number of audio bits.

Parameters:
bitsNew number of audio bits.

Reimplemented from AdjustableAudioQualityInterface.

card16  setByteOrder (const card16 byteOrder)

Set audio byte order.

Parameters:
rateNew audio byte order.

Reimplemented from AdjustableAudioQualityInterface.

void  setEncoding (const cardinal index)

Set encoding by index in client's decoder repository.

Parameters:
indexIndex in decoder repository.

inline void  setBandwidthLimit (const card32 bandwidthLimit)

Set bandwidth limit.

Parameters:
bandwidthLimitBandwidth limit.