EMIPLIB
1.2.1
|
An Open Sound System (OSS) input and output component. More...
#include <mipossinputoutput.h>
Public Types |
Public Member Functions | |
bool | open (int sampRate, int channels, MIPTime interval, AccessMode accessMode=WriteOnly, const MIPOSSInputOutputParams *pParams=0) |
Opens the soundcard device. More... | |
int | getSamplingRate () const |
Returns the sampling rate which is used. More... | |
uint32_t | getRawAudioSubtype () const |
Returns the raw audio subtype which is used by the component. More... | |
bool | close () |
Closes the device. More... | |
Public Member Functions inherited from MIPComponent | |
virtual void | lock () |
Locks the current component. More... | |
virtual void | unlock () |
Unlocks the current component. More... | |
virtual bool | processFeedback (const MIPComponentChain &chain, int64_t feedbackChainID, MIPFeedback *feedback) |
Add feedback information about this component. More... | |
std::string | getComponentName () const |
Returns the name of the component. More... | |
Public Member Functions inherited from MIPErrorBase | |
std::string | getErrorString () const |
Returns the last known error description. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from MIPComponent | |
MIPComponent (const std::string &componentName) | |
Create a component with the specified name. More... | |
Protected Member Functions inherited from MIPErrorBase | |
void | setErrorString (const std::string &str) const |
Stores an error description. More... | |
This component is an Open Sound System (OSS) soundcard input and output component. The device accepts two kinds of messages: MIPSYSTEMMESSAGE_WAITTIME messages and 16 bit raw audio messages. The first type of message uses the input part of the component, the second type is sent to the output part of the component. Messages produced by this component are 16 bit raw audio messages. A trivial echo chain would have an object of this type as start component and a connection from this object to this object, thereby immediately playing back the captured audio.
This is used to specify the access mode for the device. Use MIPOSSInputOutput::ReadOnly
to only capture audio, MIPOSSInputOutput::WriteOnly
to only play back audio and MIPOSSInputOutput::ReadWrite
to do both. The device must support full duplex mode to be opened in ReadWrite
mode.
bool MIPOSSInputOutput::close | ( | ) |
|
inline |
References MIPComponent::pull(), and MIPComponent::push().
|
inline |
bool MIPOSSInputOutput::open | ( | int | sampRate, |
int | channels, | ||
MIPTime | interval, | ||
AccessMode | accessMode = WriteOnly , |
||
const MIPOSSInputOutputParams * | pParams = 0 |
||
) |
Using this function, a soundcard device is opened and initialized.
sampRate | The sampling rate (e.g. 8000, 22050, 44100, ...) |
channels | The number of channels (e.g. 1 for mono, 2 for stereo) |
interval | This interval is used to capture audio and to play back audio. |
accessMode | Specifies the access mode for the device. |
pParams | Additional parameters. If set to null, default values will be used. |