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::IAllocator &allocator, const Config &config)
 Initialize. More...
 
bool valid () const
 Check if the object was successfully constructed. More...
 
bool open (const char *driver, const char *input)
 Open input file or device. More...
 
virtual size_t sample_rate () const
 Get sample rate of an input file or a device. More...
 
virtual bool has_clock () const
 Check if the source has own clock. More...
 
virtual State state () const
 Get current source state. More...
 
virtual void wait_active () const
 Wait until the source state becomes active. More...
 
virtual bool read (audio::Frame &)
 Read frame. More...
 

Additional Inherited Members

- Public Types inherited from roc::sndio::ISource
enum  State { Active, Inactive }
 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 32 of file sox_source.h.

Constructor & Destructor Documentation

roc::sndio::SoxSource::SoxSource ( core::IAllocator allocator,
const Config config 
)

Initialize.

Member Function Documentation

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

Check if the source has own clock.

Implements roc::sndio::ISource.

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

Open input file or device.

Parameters

  • driver is input driver name;
  • input is input file or device name, "-" for stdin.
Remarks
If driver or input are NULL, defaults are used.
virtual bool roc::sndio::SoxSource::read ( audio::Frame )
virtual

Read frame.

Implements roc::sndio::ISource.

virtual size_t roc::sndio::SoxSource::sample_rate ( ) const
virtual

Get sample rate of an input file or a device.

Implements roc::sndio::ISource.

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

Get current source state.

Implements roc::sndio::ISource.

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

Check if the object was successfully constructed.

virtual void roc::sndio::SoxSource::wait_active ( ) const
virtual

Wait until the source state becomes active.

Implements roc::sndio::ISource.


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