# UniTAP.common.audio_mode

class AudioFileFormat(enum.IntEnum):

Describe all supported audio file formats for saving audio:

- BIN.
- WAV.

UNKNOWN = <AudioFileFormat.UNKNOWN: -1>
BIN = <AudioFileFormat.BIN: 0>
WAV = <AudioFileFormat.WAV: 1>

##### Inherited Members

enum.Enum
  name
  value
builtins.int
  conjugate
  bit_length
  bit_count
  to_bytes
  from_bytes
  as_integer_ratio
  real
  imag
  numerator
  denominator

class AudioFormat(enum.IntEnum):

Describe all supported audio formats:

- PCMAudio.

Unknown = <AudioFormat.Unknown: -1>
L_PCM = <AudioFormat.L_PCM: 65535>

##### Inherited Members

enum.Enum
  name
  value
builtins.int
  conjugate
  bit_length
  bit_count
  to_bytes
  from_bytes
  as_integer_ratio
  real
  imag
  numerator
  denominator

class AudioMode:

Class `AudioMode` contains part information of audio: sample rate, count of bits and channel count.

AudioMode(sample_rate: int = 44100, bits: int = 16, channel_count: int = 2)
sample_rate
bits
channel_count
def is_valid(self) -> bool:

Check that information is valid (all values more than 0).

###### Returns:

> object of bool type.

class AudioFrameData:

Class `AudioFrameData` describes captured frame from Sink (RX - receiver) side. Contains information of audio: `AudioMode`, samples, `AudioFormat`, frame counter, `Timestamp`, audio data.

AudioFrameData( audio_mode: AudioMode = < AudioMode object>, samples: int = 0, sample_format: AudioFormat = < AudioFormat.Unknown : -1>, frame_counter: int = 0, timestamp: UniTAP.common.timestamp.Timestamp = < UniTAP.common.timestamp.Timestamp object>, data: bytearray = bytearray(b''))
channel_count: int

Returns channel count.

###### Returns:

> object of int type.

samples: int

Returns samples.

###### Returns:

> object of int type.

sample_size: int

Returns sample size.

###### Returns:

> object of int type.

sample_rate: int

Returns sample rate.

###### Returns:

> object of int type.

sample_format: AudioFormat

Returns sample format.

###### Returns:

> object of AudioFormat type.

frame_counter: int

Returns frame counter.

###### Returns:

> object of int type.

timestamp: UniTAP.common.timestamp.Timestamp

Returns timestamp.

###### Returns:

> object of Timestamp type.

data: bytearray

Returns data.

###### Returns:

> object of bytearray type.