fm.liveswitch.AudioFormat Class Reference

An audio format. More...

Public Member Functions

 AudioFormat (String name, int clockRate, int channelCount)
 Initializes a new instance of the fm.liveswitch.AudioFormat class. More...
 
 AudioFormat (String name, fm.liveswitch.AudioConfig config)
 Initializes a new instance of the fm.liveswitch.AudioFormat class. More...
 
fm.liveswitch.AudioFormat clone ()
 Clones this instance. More...
 
int getChannelCount ()
 Gets the channel count. More...
 
fm.liveswitch.AudioConfig getConfig ()
 Gets the clock rate and channel count as a configuration. More...
 
fm.liveswitch.FormatInfo getInfo ()
 Gets this format as an info object. More...
 
boolean getIsAac ()
 Gets a value indicating whether this format is AAC. More...
 
boolean getIsCompressed ()
 Gets whether this is a compressed format. More...
 
boolean getIsDtmf ()
 Gets a value indicating whether this format is DTMF. More...
 
boolean getIsG722 ()
 Gets a value indicating whether this format is G.722. More...
 
boolean getIsL16 ()
 Gets a value indicating whether this format is L16. More...
 
boolean getIsOpus ()
 Gets a value indicating whether this format is Opus. More...
 
boolean getIsPcm ()
 Gets a value indicating whether this format is PCM. More...
 
boolean getIsPcma ()
 Gets a value indicating whether this format is PCMA. More...
 
boolean getIsPcmu ()
 Gets a value indicating whether this format is PCMU. More...
 
boolean getLittleEndian ()
 Gets whether the format uses little endian byte order. More...
 
String getParameters ()
 Gets the parameters. More...
 
boolean isCompatible (fm.liveswitch.AudioFormat format)
 Determines whether the specified format is compatible. More...
 
boolean isEquivalent (fm.liveswitch.AudioFormat format, boolean ignoreIsPacketized)
 Determines whether the specified format is equivalent. More...
 
void setChannelCount (int value)
 Sets the channel count. More...
 
void setLittleEndian (boolean value)
 Sets whether the format uses little endian byte order. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 

Static Public Member Functions

static fm.liveswitch.AudioFormat fromFormatInfo (fm.liveswitch.FormatInfo info)
 Transforms a FormatInfo into an AudioFormat. More...
 
static fm.liveswitch.AudioFormat fromJson (String audioFormatJson)
 Deserializes an instance from JSON. More...
 
static String getAacName ()
 Gets the name of the AAC audio format ("aac"). More...
 
static String getDtmfName ()
 Gets the name of the DTMF audio format ("telephone-event"). More...
 
static String getG722Name ()
 Gets the name of the G.722 audio format ("G722"). More...
 
static String getL16Name ()
 Gets the name of the Linear PCM 16-bit audio (PCM Uncompressed). More...
 
static String getOpusName ()
 Gets the name of the Opus audio format ("opus"). More...
 
static String getPcmaName ()
 Gets the name of the PCMA audio format ("PCMA"). More...
 
static String getPcmName ()
 Gets the name of the PCM audio format ("PCM"). More...
 
static String getPcmuName ()
 Gets the name of the PCMU audio format ("PCMU"). More...
 
static String toJson (final fm.liveswitch.AudioFormat audioFormat)
 Serializes an instance to JSON. More...
 

Protected Member Functions

 AudioFormat ()
 Initializes a new instance of the fm.liveswitch.AudioFormat class. More...
 
fm.liveswitch.AudioFormat createInstance ()
 Creates a new instance. More...
 

Detailed Description

An audio format.

Constructor & Destructor Documentation

◆ AudioFormat() [1/3]

fm.liveswitch.AudioFormat.AudioFormat ( )
protected

Initializes a new instance of the fm.liveswitch.AudioFormat class.

◆ AudioFormat() [2/3]

fm.liveswitch.AudioFormat.AudioFormat ( String  name,
int  clockRate,
int  channelCount 
)

Initializes a new instance of the fm.liveswitch.AudioFormat class.

Parameters
nameThe name.
clockRateThe clock rate.
channelCountThe channel count.

◆ AudioFormat() [3/3]

fm.liveswitch.AudioFormat.AudioFormat ( String  name,
fm.liveswitch.AudioConfig  config 
)

Initializes a new instance of the fm.liveswitch.AudioFormat class.

Parameters
nameThe name.
configThe configuration.

Member Function Documentation

◆ clone()

fm.liveswitch.AudioFormat fm.liveswitch.AudioFormat.clone ( )

Clones this instance.

◆ createInstance()

fm.liveswitch.AudioFormat fm.liveswitch.AudioFormat.createInstance ( )
protected

◆ fromFormatInfo()

static fm.liveswitch.AudioFormat fm.liveswitch.AudioFormat.fromFormatInfo ( fm.liveswitch.FormatInfo  info)
static

Transforms a FormatInfo into an AudioFormat.

Parameters
infoThe format info.

◆ fromJson()

static fm.liveswitch.AudioFormat fm.liveswitch.AudioFormat.fromJson ( String  audioFormatJson)
static

Deserializes an instance from JSON.

Parameters
audioFormatJsonThe audio format JSON.

◆ getAacName()

static String fm.liveswitch.AudioFormat.getAacName ( )
static

Gets the name of the AAC audio format ("aac").

◆ getChannelCount()

int fm.liveswitch.AudioFormat.getChannelCount ( )

Gets the channel count.

◆ getConfig()

fm.liveswitch.AudioConfig fm.liveswitch.AudioFormat.getConfig ( )

Gets the clock rate and channel count as a configuration.

◆ getDtmfName()

static String fm.liveswitch.AudioFormat.getDtmfName ( )
static

Gets the name of the DTMF audio format ("telephone-event").

◆ getG722Name()

static String fm.liveswitch.AudioFormat.getG722Name ( )
static

Gets the name of the G.722 audio format ("G722").

◆ getInfo()

fm.liveswitch.FormatInfo fm.liveswitch.AudioFormat.getInfo ( )

Gets this format as an info object.

◆ getIsAac()

boolean fm.liveswitch.AudioFormat.getIsAac ( )

Gets a value indicating whether this format is AAC.

◆ getIsCompressed()

boolean fm.liveswitch.AudioFormat.getIsCompressed ( )

Gets whether this is a compressed format.

◆ getIsDtmf()

boolean fm.liveswitch.AudioFormat.getIsDtmf ( )

Gets a value indicating whether this format is DTMF.

◆ getIsG722()

boolean fm.liveswitch.AudioFormat.getIsG722 ( )

Gets a value indicating whether this format is G.722.

◆ getIsL16()

boolean fm.liveswitch.AudioFormat.getIsL16 ( )

Gets a value indicating whether this format is L16.

◆ getIsOpus()

boolean fm.liveswitch.AudioFormat.getIsOpus ( )

Gets a value indicating whether this format is Opus.

◆ getIsPcm()

boolean fm.liveswitch.AudioFormat.getIsPcm ( )

Gets a value indicating whether this format is PCM.

◆ getIsPcma()

boolean fm.liveswitch.AudioFormat.getIsPcma ( )

Gets a value indicating whether this format is PCMA.

◆ getIsPcmu()

boolean fm.liveswitch.AudioFormat.getIsPcmu ( )

Gets a value indicating whether this format is PCMU.

◆ getL16Name()

static String fm.liveswitch.AudioFormat.getL16Name ( )
static

Gets the name of the Linear PCM 16-bit audio (PCM Uncompressed).

◆ getLittleEndian()

boolean fm.liveswitch.AudioFormat.getLittleEndian ( )

Gets whether the format uses little endian byte order.

◆ getOpusName()

static String fm.liveswitch.AudioFormat.getOpusName ( )
static

Gets the name of the Opus audio format ("opus").

◆ getParameters()

String fm.liveswitch.AudioFormat.getParameters ( )

Gets the parameters.

◆ getPcmaName()

static String fm.liveswitch.AudioFormat.getPcmaName ( )
static

Gets the name of the PCMA audio format ("PCMA").

◆ getPcmName()

static String fm.liveswitch.AudioFormat.getPcmName ( )
static

Gets the name of the PCM audio format ("PCM").

◆ getPcmuName()

static String fm.liveswitch.AudioFormat.getPcmuName ( )
static

Gets the name of the PCMU audio format ("PCMU").

◆ isCompatible()

boolean fm.liveswitch.AudioFormat.isCompatible ( fm.liveswitch.AudioFormat  format)

Determines whether the specified format is compatible.

Parameters
formatThe format.

◆ isEquivalent()

boolean fm.liveswitch.AudioFormat.isEquivalent ( fm.liveswitch.AudioFormat  format,
boolean  ignoreIsPacketized 
)

Determines whether the specified format is equivalent.

Parameters
formatThe format.
ignoreIsPacketizedWhether to ignore if the two formats differ in whether they are packetized.

◆ setChannelCount()

void fm.liveswitch.AudioFormat.setChannelCount ( int  value)

Sets the channel count.

◆ setLittleEndian()

void fm.liveswitch.AudioFormat.setLittleEndian ( boolean  value)

Sets whether the format uses little endian byte order.

◆ toJson() [1/2]

String fm.liveswitch.AudioFormat.toJson ( )

Serializes this instance to JSON.

◆ toJson() [2/2]

static String fm.liveswitch.AudioFormat.toJson ( final fm.liveswitch.AudioFormat  audioFormat)
static

Serializes an instance to JSON.

Parameters
audioFormatThe audio format.