EMIPLIB
|
A PortAudio input and output component. More...
#include <mippainputoutput.h>
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, MIPTime bufferTime=MIPTime(10.0)) |
Opens the soundcard device. | |
bool | close () |
Closes the device. | |
Static Public Member Functions | |
static bool | initializePortAudio (std::string &errorString) |
Initializes the PortAudio library and stores an error message if something goes wrong. | |
static void | terminatePortAudio () |
De-initializes the PortAudio library. |
This component is a PortAudio soundcard input and output component. The device accepts two kinds of messages: MIPSYSTEMMESSAGE_WAITTIME messages and 16 bit little endian raw audio messages (native endianness). The first 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 native endian raw audio messages.
This is used to specify the access mode for the device. Use MIPPAInputOutput::ReadOnly
to only capture audio, MIPPAInputOutput::WriteOnly
to only play back audio and MIPPAInputOutput::ReadWrite
to do both. The device must support full duplex mode to be opened in ReadWrite
mode.
bool MIPPAInputOutput::close | ( | ) |
bool MIPPAInputOutput::open | ( | int | sampRate, |
int | channels, | ||
MIPTime | interval, | ||
AccessMode | accessMode = WriteOnly , |
||
MIPTime | bufferTime = MIPTime(10.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. |
bufferTime | Specifies how much memory is preallocated internally. |
static void MIPPAInputOutput::terminatePortAudio | ( | ) | [static] |