EMIPLIB
Public Types | Public Member Functions

MIPOSSInputOutput Class Reference

An Open Sound System (OSS) input and output component. More...

#include <mipossinputoutput.h>

Inheritance diagram for MIPOSSInputOutput:
Inheritance graph
[legend]
Collaboration diagram for MIPOSSInputOutput:
Collaboration graph
[legend]

List of all members.

Public Types

enum  AccessMode
 

Indicates the access mode for the device.

More...

Public Member Functions

bool open (int sampRate, int channels, MIPTime interval, AccessMode accessMode=WriteOnly, const MIPOSSInputOutputParams *pParams=0)
 Opens the soundcard device.
int getSamplingRate () const
 Returns the sampling rate which is used.
uint32_t getRawAudioSubtype () const
 Returns the raw audio subtype which is used by the component.
bool close ()
 Closes the device.

Detailed Description

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.


Member Enumeration Documentation

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.


Member Function Documentation

bool MIPOSSInputOutput::close ( )
uint32_t MIPOSSInputOutput::getRawAudioSubtype ( ) const [inline]
int MIPOSSInputOutput::getSamplingRate ( ) const [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.

Parameters:
sampRateThe sampling rate (e.g. 8000, 22050, 44100, ...)
channelsThe number of channels (e.g. 1 for mono, 2 for stereo)
intervalThis interval is used to capture audio and to play back audio.
accessModeSpecifies the access mode for the device.
pParamsAdditional parameters. If set to null, default values will be used.

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