Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::audio Namespace Reference

Audio frames and audio processing. More...

Classes

class  BuiltinResampler
 Resamples audio stream with non-integer dynamically changing factor. More...
 
class  ChannelMapper
 Channel mapper. Converts between frames with specified channel masks. More...
 
class  ChannelMapperReader
 Channel mapper reader. Reads frames from nested reader and maps them to another channel mask. More...
 
class  ChannelMapperWriter
 Channel mapper writer. Reads frames from nested writer and maps them to another channel mask. More...
 
class  Depacketizer
 Depacketizer. More...
 
class  Fanout
 Fanout. Duplicates audio stream to multiple output writers. More...
 
class  Frame
 Audio frame. More...
 
class  FreqEstimator
 Evaluates sender's frequency to receivers's frequency ratio. More...
 
struct  FreqEstimatorConfig
 FreqEstimator tunable parameters. More...
 
class  IFrameDecoder
 Audio frame decoder interface. More...
 
class  IFrameEncoder
 Audio frame encoder interface. More...
 
class  IFrameReader
 Frame reader interface. More...
 
class  IFrameWriter
 Frame writer interface. More...
 
class  IResampler
 Audio writer interface. More...
 
class  LatencyMonitor
 Session latency monitor. More...
 
struct  LatencyMonitorConfig
 Parameters for latency monitor. More...
 
class  Mixer
 Mixer. Mixes multiple input streams into one output stream. More...
 
class  NullWriter
 Null writer. More...
 
class  Packetizer
 Packetizer. More...
 
class  PcmDecoder
 PCM decoder. More...
 
class  PcmEncoder
 PCM encoder. More...
 
struct  PcmFormat
 PCM format description. More...
 
class  PcmMapper
 PCM format mapper. Convert between PCM formats. More...
 
class  PoisonReader
 Poisons audio frames before reading them. More...
 
class  PoisonWriter
 Poisons audio frames after writing them. More...
 
class  Profiler
 Profiler The role of the profiler is to report the average processing speed (# of samples processed per time unit) during the last N seconds. We want to calculate the average processing speed efficiently (with O(1) complexity, without allocations, and as lightweight as possible). The problems with this are that the we have variable-sized frames and SMA requires fixed size chunks. To efficiently perform this calculation a ring buffer is employed. The idea behind the ring buffer is that each chunk of the buffer is the average speed of 10ms worth of samples. The ring buffer is initialized with fixed size (N * 1000)ms / (10ms) chunks. Within each chunk a weighted mean is used to calculate the average speed during those 10ms. Each frame will contribute a different number of samples to each chunk, the chunk speed is then weighted based on how many samples are contributed at what frame speed. As the chunks get populated the moving average is calculated. When the buffer is not entirely full the cumulative moving average algorithm is used and once the buffer is full the simple moving average algorithm is used. More...
 
struct  ProfilerConfig
 Profiler Configuration Parameters. Controls profiling interval and duration of each circular buffer chunk. More...
 
class  ProfilingReader
 Profiling reader. More...
 
class  ProfilingWriter
 Profiling writer. More...
 
class  ResamplerMap
 Factory class for IResampler objects, according to the ResamplerBackend input. More...
 
class  ResamplerReader
 Resampler element for reading pipeline. More...
 
class  ResamplerWriter
 Resampler element for writing pipeline. More...
 
class  SampleSpec
 Sample stream specification. Defines sample rate and channel layout. More...
 
class  SpeexResampler
 Resamples audio stream using speex resampler. More...
 
class  Watchdog
 Watchdog. More...
 
struct  WatchdogConfig
 Watchdog parameters. More...
 

Typedefs

typedef float sample_t
 Audio sample.
 

Enumerations

enum  PcmEncoding {
  PcmEncoding_SInt8 , PcmEncoding_UInt8 , PcmEncoding_SInt16 , PcmEncoding_UInt16 ,
  PcmEncoding_SInt18 , PcmEncoding_UInt18 , PcmEncoding_SInt18_3B , PcmEncoding_UInt18_3B ,
  PcmEncoding_SInt18_4B , PcmEncoding_UInt18_4B , PcmEncoding_SInt20 , PcmEncoding_UInt20 ,
  PcmEncoding_SInt20_3B , PcmEncoding_UInt20_3B , PcmEncoding_SInt20_4B , PcmEncoding_UInt20_4B ,
  PcmEncoding_SInt24 , PcmEncoding_UInt24 , PcmEncoding_SInt24_4B , PcmEncoding_UInt24_4B ,
  PcmEncoding_SInt32 , PcmEncoding_UInt32 , PcmEncoding_SInt64 , PcmEncoding_UInt64 ,
  PcmEncoding_Float32 , PcmEncoding_Float64
}
 PCM sample encoding. More...
 
enum  PcmEndian { PcmEndian_Native , PcmEndian_Big , PcmEndian_Little }
 PCM sample endianess. More...
 
enum  ResamplerBackend { ResamplerBackend_Default , ResamplerBackend_Builtin , ResamplerBackend_Speex }
 Resampler backends. More...
 
enum  ResamplerProfile { ResamplerProfile_Low , ResamplerProfile_Medium , ResamplerProfile_High }
 Resampler parameters presets. More...
 

Functions

const char * resampler_backend_to_str (ResamplerBackend)
 Get string name of resampler backend.
 

Variables

const sample_t fe_decim_h [fe_decim_len]
 Impulse response of decimation filter with factor of 10.
 
const sample_t fe_decim_h_gain
 Filters gain, sum(fe_decim_h).
 
const PcmFormat SampleFormat
 Sample format description.
 
const sample_t SampleMin
 Minimum possible value of a sample.
 
const sample_t SampleMax
 Maximum possible value of a sample.
 

Detailed Description

Audio frames and audio processing.

Typedef Documentation

◆ sample_t

typedef float roc::audio::sample_t

Audio sample.

Definition at line 22 of file sample.h.

Enumeration Type Documentation

◆ PcmEncoding

PCM sample encoding.

Enumerator
PcmEncoding_SInt8 

8-bit signed integer.

PcmEncoding_UInt8 

8-bit unsigned integer.

PcmEncoding_SInt16 

16-bit signed integer.

PcmEncoding_UInt16 

16-bit unsigned integer.

PcmEncoding_SInt18 

18-bit signed integer (2.25 bytes).

PcmEncoding_UInt18 

18-bit unsigned integer (2.25 bytes).

PcmEncoding_SInt18_3B 

18-bit signed integer, in low bits of 3-byte container.

PcmEncoding_UInt18_3B 

18-bit unsigned integer, in low bits of 3-byte container.

PcmEncoding_SInt18_4B 

18-bit signed integer, in low bits of 4-byte container.

PcmEncoding_UInt18_4B 

18-bit unsigned integer, in low bits of 4-byte container.

PcmEncoding_SInt20 

20-bit signed integer (2.5 bytes).

PcmEncoding_UInt20 

20-bit unsigned integer (2.5 bytes).

PcmEncoding_SInt20_3B 

20-bit signed integer, in low bits of 3-byte container.

PcmEncoding_UInt20_3B 

20-bit unsigned integer, in low bits of 3-byte container.

PcmEncoding_SInt20_4B 

20-bit signed integer, in low bits of 4-byte container.

PcmEncoding_UInt20_4B 

20-bit unsigned integer, in low bits of 4-byte container.

PcmEncoding_SInt24 

24-bit signed integer (3 bytes).

PcmEncoding_UInt24 

24-bit unsigned integer (3 bytes).

PcmEncoding_SInt24_4B 

24-bit signed integer, in low bits of 4-byte container.

PcmEncoding_UInt24_4B 

24-bit unsigned integer, in low bits of 4-byte container.

PcmEncoding_SInt32 

32-bit signed integer.

PcmEncoding_UInt32 

32-bit unsigned integer.

PcmEncoding_SInt64 

64-bit signed integer.

PcmEncoding_UInt64 

64-bit unsigned integer.

PcmEncoding_Float32 

32-bit IEEE-754 float in range [-1.0; +1.0].

PcmEncoding_Float64 

64-bit IEEE-754 float in range [-1.0; +1.0].

Definition at line 21 of file pcm_format.h.

◆ PcmEndian

PCM sample endianess.

Enumerator
PcmEndian_Native 

Endian native to current CPU.

PcmEndian_Big 

Big endian.

PcmEndian_Little 

Little endian.

Definition at line 51 of file pcm_format.h.

◆ ResamplerBackend

Resampler backends.

Enumerator
ResamplerBackend_Default 

Default backend.

ResamplerBackend_Builtin 

Roc built-in resampler.

ResamplerBackend_Speex 

SpeexDSP resampler.

Definition at line 19 of file resampler_backend.h.

◆ ResamplerProfile

Resampler parameters presets.

Enumerator
ResamplerProfile_Low 

Low quality, fast speed.

ResamplerProfile_Medium 

Medium quality, medium speed.

ResamplerProfile_High 

Hight quality, low speed.

Definition at line 19 of file resampler_profile.h.

Function Documentation

◆ resampler_backend_to_str()

const char * roc::audio::resampler_backend_to_str ( ResamplerBackend  )

Get string name of resampler backend.

Variable Documentation

◆ fe_decim_h

const sample_t roc::audio::fe_decim_h[fe_decim_len]
extern

Impulse response of decimation filter with factor of 10.

◆ fe_decim_h_gain

const sample_t roc::audio::fe_decim_h_gain
extern

Filters gain, sum(fe_decim_h).

◆ SampleFormat

const PcmFormat roc::audio::SampleFormat
extern

Sample format description.

◆ SampleMax

const sample_t roc::audio::SampleMax
extern

Maximum possible value of a sample.

◆ SampleMin

const sample_t roc::audio::SampleMin
extern

Minimum possible value of a sample.