Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::sndio Namespace Reference

Sound I/O. More...

Classes

class  BackendDispatcher
 Backend dispatcher. More...
 
class  BackendMap
 Backend map. More...
 
struct  Config
 Sink and source config. More...
 
struct  DriverInfo
 Driver information. More...
 
class  IBackend
 Backend interface. More...
 
class  IDevice
 Base interface for sinks and sources. More...
 
class  ISink
 Sink interface. More...
 
class  ISource
 Source interface. More...
 
class  Pump
 Audio pump. More...
 
class  PulseaudioBackend
 Pulseaudio backend. More...
 
class  PulseaudioDevice
 PulseAudio device. Can be either source or sink depending on constructor parameter. More...
 
class  SndfileBackend
 Sndfile backend. More...
 
class  SndfileSink
 Sndfile sink. More...
 
class  SndfileSource
 Sndfile source. More...
 
class  SoxBackend
 SoX backend. More...
 
class  SoxSink
 SoX sink. More...
 
class  SoxSource
 SoX source. More...
 
class  WavBackend
 WAV backend. More...
 
class  WavHeader
 WAV header. More...
 
class  WavSink
 WAV sink. More...
 
class  WavSource
 WAV source. More...
 

Enumerations

enum  DeviceState { DeviceState_Active , DeviceState_Idle , DeviceState_Paused }
 Device state. More...
 
enum  DeviceType { DeviceType_Sink , DeviceType_Source }
 Device type. More...
 
enum  DriverType { DriverType_Invalid , DriverType_File , DriverType_Device }
 Driver type. More...
 
enum  DriverFlags { DriverFlag_IsDefault = (1 << 0) , DriverFlag_SupportsSource = (1 << 1) , DriverFlag_SupportsSink = (1 << 2) }
 Driver flags. More...
 

Functions

const char * device_state_to_str (DeviceState state)
 Convert device state to string. More...
 
const char * device_type_to_str (DeviceType type)
 Convert device type to string. More...
 
const char * driver_type_to_str (DriverType type)
 Convert driver type to string. More...
 
ROC_ATTR_NODISCARD bool print_supported (BackendDispatcher &backend_dispatcher, core::IArena &arena)
 Print supported schemes and formats. More...
 

Variables

const core::nanoseconds_t DefaultFrameLength = 10 * core::Millisecond
 Default frame length. 10ms is rather high, but works well even on cheap sound cards and CPUs. Usually you can use much lower values. More...
 

Detailed Description

Sound I/O.

Enumeration Type Documentation

◆ DeviceState

Device state.

Enumerator
DeviceState_Active 

Device is running and active. It is producing some sound.

DeviceState_Idle 

Device is running but is inactive. It is producing silence. It may be safely paused.

DeviceState_Paused 

Device is paused. It's not producing anything.

Definition at line 19 of file device_state.h.

◆ DeviceType

Device type.

Enumerator
DeviceType_Sink 

Sink.

DeviceType_Source 

Source.

Definition at line 19 of file device_type.h.

◆ DriverFlags

Driver flags.

Enumerator
DriverFlag_IsDefault 

Driver is used if no file or device is specified.

DriverFlag_SupportsSource 

Driver supports sources (input).

DriverFlag_SupportsSink 

Driver supports sinks (output).

Definition at line 39 of file driver.h.

◆ DriverType

Driver type.

Enumerator
DriverType_Invalid 

Invalid type.

DriverType_File 

Driver for audio files.

DriverType_Device 

Driver for audio devices.

Definition at line 27 of file driver.h.

Function Documentation

◆ device_state_to_str()

const char* roc::sndio::device_state_to_str ( DeviceState  state)

Convert device state to string.

◆ device_type_to_str()

const char* roc::sndio::device_type_to_str ( DeviceType  type)

Convert device type to string.

◆ driver_type_to_str()

const char* roc::sndio::driver_type_to_str ( DriverType  type)

Convert driver type to string.

◆ print_supported()

ROC_ATTR_NODISCARD bool roc::sndio::print_supported ( BackendDispatcher backend_dispatcher,
core::IArena arena 
)

Print supported schemes and formats.

Variable Documentation

◆ DefaultFrameLength

const core::nanoseconds_t roc::sndio::DefaultFrameLength = 10 * core::Millisecond

Default frame length. 10ms is rather high, but works well even on cheap sound cards and CPUs. Usually you can use much lower values.

Definition at line 26 of file config.h.