AudiClean
Public Member Functions | List of all members
SoxReader Class Reference

#include <SoxReader.h>

Inheritance diagram for SoxReader:
Inheritance graph
Collaboration diagram for SoxReader:
Collaboration graph

Public Member Functions

bool Open (int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename)
 
std::thread * Start (int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename)
 
void ForceStop ()
 
void Run ()
 
int GetNumChannels ()
 
int GetSampleRate ()
 
void SetOn (bool val)
 

Additional Inherited Members

Detailed Description

A pipeline element which allows samples to be piped from the SoX program.

Member Function Documentation

◆ ForceStop()

void SoxReader::ForceStop ( )

Brute-force stop the SoxReader, will attempt to close the pipe and join the worker thread.

◆ GetNumChannels()

int SoxReader::GetNumChannels ( )

Gets the nr of channels in the audio file to open

Returns

◆ GetSampleRate()

int SoxReader::GetSampleRate ( )

Gets the sample rate of the audio file to open

Returns

◆ Open()

bool SoxReader::Open ( int  rate,
int  nchan,
std::string  globalopts,
std::string  fileopts,
std::string  filename 
)

Open the pipe from SoX

Parameters
rate
nchan
globalopts
fileopts
filename
Returns
true if opening file successful, false otherwise.

◆ Run()

void SoxReader::Run ( )

Work function for the worker thread, reads samples from the SoX pipe, processes them and passes on to the next pipeline element. Continues while isOn is set and the end of the pipe is not reached.

◆ SetOn()

void SoxReader::SetOn ( bool  val)

Sets the isOn status of the SoxReader

Parameters
val

◆ Start()

std::thread * SoxReader::Start ( int  rate,
int  nchan,
std::string  globalopts,
std::string  fileopts,
std::string  filename 
)

Starts reading from the pipe from SoX, returns a thread which lives as long as the pipe does

Parameters
rate
nchan
globalopts
fileopts
filename
Returns

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