Yate: FormatInfo Struct Reference

Yate

Public Member Functions | Public Attributes | List of all members
FormatInfo Struct Reference

`#include <yatephone.h>`

## Public Member Functions
int | guessSamples (int len) const
int | dataRate () const
| FormatInfo ()
| FormatInfo (const char *_name, int fsize=0, int ftime=10000, const char *_type="audio", int srate=8000, int nchan=1, bool convert=false)

## Public Attributes
const char * | name
const char * | type
int | frameSize
int | frameTime
int | sampleRate
int | numChannels
bool | converter

## Detailed Description

A structure to hold information about a data format.

## Constructor & Destructor Documentation

## ◆ FormatInfo() [1/2]

FormatInfo | ( |  | ) |
| inline

Default constructor - used to initialize arrays

## ◆ FormatInfo() [2/2]

FormatInfo | ( | const char * | _name,
|  | int | fsize = 0,
|  | int | ftime = 10000,
|  | const char * | _type = "audio",
|  | int | srate = 8000,
|  | int | nchan = 1,
|  | bool | convert = false )
| inlineexplicit

Normal constructor

## Member Function Documentation

## ◆ dataRate()

int dataRate | ( |  | ) | const

Get the data rate in bytes/s

Returns
  Data rate or 0 if variable/undefined

## ◆ guessSamples()

int guessSamples | ( | int | len | ) | const

Guess the number of samples in an encoded data block

Parameters

  len | Length of the data block in octets

Returns
  Number of samples or 0 if unknown

## Member Data Documentation

## ◆ converter

bool converter

If this is a valid candidate for conversion

## ◆ frameSize

int frameSize

Frame size in octets/frame, 0 for non-framed formats

Referenced by DataFormat::frameSize().

## ◆ frameTime

int frameTime

Frame time in microseconds, 0 for variable

Referenced by DataFormat::frameTime().

## ◆ name

const char* name

Standard no-blanks lowercase format name

## ◆ numChannels

int numChannels

Number of channels, typically 1

Referenced by DataFormat::numChannels().

## ◆ sampleRate

int sampleRate

Rate in samples/second (audio) or 1e-6 frames/second (video), 0 for unknown

Referenced by DataFormat::sampleRate().

## ◆ type

const char* type

Format type: "audio", "video", "text"

The documentation for this struct was generated from the following file:

- yatephone.h