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

SoX source. More...

#include <sox_source.h>

Inheritance diagram for roc::sndio::SoxSource:
Collaboration diagram for roc::sndio::SoxSource:

Public Member Functions

 SoxSource (core::IArena &arena, const Config &config)
 Initialize. More...
 
bool is_valid () const
 Check if the object was successfully constructed. More...
 
bool open (const char *driver, const char *path)
 Open input file or device. More...
 
virtual DeviceType type () const
 Get device type. More...
 
virtual DeviceState state () const
 Get device state. More...
 
virtual void pause ()
 Pause reading. More...
 
virtual bool resume ()
 Resume paused reading. More...
 
virtual bool restart ()
 Restart reading from the beginning. More...
 
virtual audio::SampleSpec sample_spec () const
 Get sample specification of the source. More...
 
virtual core::nanoseconds_t latency () const
 Get latency of the source. More...
 
virtual bool has_latency () const
 Check if the source supports latency reports. More...
 
virtual bool has_clock () const
 Check if the source has own clock. More...
 
virtual void reclock (core::nanoseconds_t timestamp)
 Adjust source clock to match consumer clock. More...
 
virtual bool read (audio::Frame &)
 Read frame. More...
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data. More...
 

Detailed Description

SoX source.

Remarks
Reads samples from input file or device. Supports multiple drivers for different file types and audio systems.

Definition at line 34 of file sox_source.h.

Constructor & Destructor Documentation

◆ SoxSource()

roc::sndio::SoxSource::SoxSource ( core::IArena arena,
const Config config 
)

Initialize.

Member Function Documentation

◆ has_clock()

virtual bool roc::sndio::SoxSource::has_clock ( ) const
virtual

Check if the source has own clock.

Implements roc::sndio::IDevice.

◆ has_latency()

virtual bool roc::sndio::SoxSource::has_latency ( ) const
virtual

Check if the source supports latency reports.

Implements roc::sndio::IDevice.

◆ is_valid()

bool roc::sndio::SoxSource::is_valid ( ) const

Check if the object was successfully constructed.

◆ latency()

virtual core::nanoseconds_t roc::sndio::SoxSource::latency ( ) const
virtual

Get latency of the source.

Implements roc::sndio::IDevice.

◆ open()

bool roc::sndio::SoxSource::open ( const char *  driver,
const char *  path 
)

Open input file or device.

Parameters

  • driver is input driver name;
  • path is input file or device name, "-" for stdin.
Remarks
If driver or path are NULL, defaults are used.

◆ pause()

virtual void roc::sndio::SoxSource::pause ( )
virtual

Pause reading.

Implements roc::sndio::IDevice.

◆ read()

virtual bool roc::sndio::SoxSource::read ( audio::Frame )
virtual

Read frame.

Implements roc::audio::IFrameReader.

◆ reclock()

virtual void roc::sndio::SoxSource::reclock ( core::nanoseconds_t  timestamp)
virtual

Adjust source clock to match consumer clock.

Implements roc::sndio::ISource.

◆ restart()

virtual bool roc::sndio::SoxSource::restart ( )
virtual

Restart reading from the beginning.

Implements roc::sndio::IDevice.

◆ resume()

virtual bool roc::sndio::SoxSource::resume ( )
virtual

Resume paused reading.

Implements roc::sndio::IDevice.

◆ sample_spec()

virtual audio::SampleSpec roc::sndio::SoxSource::sample_spec ( ) const
virtual

Get sample specification of the source.

Implements roc::sndio::IDevice.

◆ state()

virtual DeviceState roc::sndio::SoxSource::state ( ) const
virtual

Get device state.

Implements roc::sndio::IDevice.

◆ type()

virtual DeviceType roc::sndio::SoxSource::type ( ) const
virtual

Get device type.

Implements roc::sndio::IDevice.


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