SPKitAudioPort


User's Guide

SPKitAudioPort is a representative for a full-duplex AD/DA converter device. It allows samples to be read and written from and to the AD/DA device. SPKitAudioPort is an abstract superclass for various audio I/O implementations. It is, therefore, not intended for direct use.

SPKitOSSAudioPort (a subclass of SPKitAudioPort) is an audio port implementation for Open Sound System compatible environments.

The current version works only under Linux 2.2 (or above) kernels or on other Open Sound System compatible platforms.

SPKitAudioPort acts like a combination of SPKitReader and SPKitWriter. I.e. it can be used as both an input and output for an SPKit patch. The setInput() function, inherited from SPKitProcessor, is used to connect objects as inputs to SPKitAudioPort. Respectively, being a supclass of SPKitProcessor, SPKitAudioPort may be connected as an input to other SPKit objects.


Programmer's Reference

Defined in <spkit/audiopor.h>
Inherits from SPKitProcessor

SPKitAudioPort defines run() and runFor() functions for reading and writing audio samples from the AD/DA converter. An init() function is defined for initializing the audio device. Subclasses are expected to override these functions as well as the getSample() function for their specific audio I/O system implementations.

Public Members

SPKitAudioPort()
The default constructor. Uses the default DSP device "/dev/dsp". Supclasses may implement alternative constructors if needed.

SPKitInt run()
Perform audio I/O until the signal input object runs out of samples.

SPKitInt runFor(SPKitInt nSamples)
Perform audio I/O for a specified number of samples. Returns the number of samples processed.

SPKitError init()
Initialize the I/O device.

Protected Members

None.
Return to top level

Author: Kai Lassfolk