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

SoX source. More...

#include <sox_source.h>

Inheritance diagram for roc::sndio::SoxSource:
roc::sndio::ISource roc::core::NonCopyable< T > roc::sndio::ITerminal roc::audio::IFrameReader roc::core::ListNode roc::core::NonCopyable< ListNode >

Public Member Functions

 SoxSource (core::IAllocator &allocator, const Config &config)
 Initialize.
 
bool valid () const
 Check if the object was successfully constructed.
 
bool open (const char *driver, const char *path)
 Open input file or device.
 
virtual audio::SampleSpec sample_spec () const
 Get sample specification of the source.
 
virtual core::nanoseconds_t latency () const
 Get latency of the source.
 
virtual bool has_clock () const
 Check if the source has own clock.
 
virtual State state () const
 Get current source state.
 
virtual void pause ()
 Pause reading.
 
virtual bool resume ()
 Resume paused reading.
 
virtual bool restart ()
 Restart reading from the beginning.
 
virtual void reclock (packet::ntp_timestamp_t timestamp)
 Adjust source clock to match consumer clock.
 
virtual bool read (audio::Frame &)
 Read frame.
 
virtual State state () const =0
 Get current source state.
 
virtual void pause ()=0
 Pause reading.
 
virtual bool resume ()=0
 Resume paused reading.
 
virtual bool restart ()=0
 Restart reading from the beginning.
 
virtual void reclock (packet::ntp_timestamp_t timestamp)=0
 Adjust source clock to match consumer clock.
 
virtual audio::SampleSpec sample_spec () const =0
 Get sample specification of the terminal.
 
virtual core::nanoseconds_t latency () const =0
 Get latency of the terminal.
 
virtual bool has_clock () const =0
 Check if the terminal has own clock.
 
virtual bool read (Frame &frame)=0
 Read audio frame.
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data.
 

Additional Inherited Members

- Public Types inherited from roc::sndio::ISource
enum  State { Playing , Idle , Paused }
 Source state. 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::IAllocator allocator,
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::ITerminal.

◆ latency()

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

Get latency of the source.

Implements roc::sndio::ITerminal.

◆ 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::ISource.

◆ read()

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

Read frame.

Implements roc::audio::IFrameReader.

◆ reclock()

virtual void roc::sndio::SoxSource::reclock ( packet::ntp_timestamp_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::ISource.

◆ resume()

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

Resume paused reading.

Implements roc::sndio::ISource.

◆ sample_spec()

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

Get sample specification of the source.

Implements roc::sndio::ITerminal.

◆ state()

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

Get current source state.

Implements roc::sndio::ISource.

◆ valid()

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

Check if the object was successfully constructed.


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