|
|
An audio input based on /dev/dsp-like raw devices
| char * fileName | fileName |
[private]
| int fileDescriptor | fileDescriptor |
[private]
| bool running | running |
[private]
| inline
OssDspSource ( void )
throw ( Exception ) | OssDspSource |
[protected]
Default constructor. Always throws an Exception.
Throws: Exception
| void
init ( const char * name )
throw ( Exception ) | init |
[protected]
Initialize the object
Parameters:
| name | the file name of the OSS DSP device. |
Throws: Exception
Reimplemented from AudioSource.
| void
strip ( void )
throw ( Exception ) | strip |
[protected]
De-iitialize the object
Throws: Exception
Reimplemented from AudioSource.
| inline
OssDspSource ( const char * name,
int sampleRate = 44100,
int bitsPerSample = 16,
int channel = 2 )
throw ( Exception ) | OssDspSource |
Constructor.
Parameters:
| name | the file name of the OSS DSP device (e.g. /dev/dsp or /dev/dsp0). |
| sampleRate | samples per second (e.g. 44100 for 44.1kHz). |
| bitsPerSample | bits per sample (e.g. 16 bits). |
| channel | number of channels of the audio source (e.g. 1 for mono, 2 for stereo, etc.). |
Throws: Exception
| inline
OssDspSource ( const OssDspSource & ds )
throw ( Exception ) | OssDspSource |
Copy Constructor.
Parameters:
| source | the object to copy. |
Throws: Exception
| inline
~OssDspSource ( void )
throw ( Exception ) | ~OssDspSource |
[virtual]
Destructor.
Throws: Exception
| inline OssDspSource &
operator= ( const OssDspSource & ds )
throw ( Exception ) | operator= |
[virtual]
Assignment operator.
Parameters:
| ds | the object to assign to this one. |
Returns: a reference to this object.
Throws: Exception
Reimplemented from AudioSource.
| bool
isBigEndian ( void )
throw () | isBigEndian |
[const virtual]
Tell if the data from this source comes in big or little endian.
Returns: true if the source is big endian, false otherwise
Reimplemented from AudioSource.
| bool
open ( void )
throw ( Exception ) | open |
[virtual]
Open the OssDspSource. This does not put the OSS DSP device into recording mode. To start getting samples, call either canRead() or read().
Returns: true if opening was successful, false otherwise
Throws: Exception
Reimplemented from Source.
| inline bool
isOpen ( void )
throw () | isOpen |
[const virtual]
Check if the OssDspSource is open.
Returns: true if the OssDspSource is open, false otherwise.
Reimplemented from Source.
| bool
canRead ( unsigned int sec,
unsigned int usec )
throw ( Exception ) | canRead |
[virtual]
Check if the OssDspSource can be read from. Blocks until the specified time for data to be available. Puts the OSS DSP device into recording mode.
Parameters:
| sec | the maximum seconds to block. |
| usec | micro seconds to block after the full seconds. |
Returns: true if the OssDspSource is ready to be read from, false otherwise.
Throws: Exception
Reimplemented from Source.
| unsigned int
read ( void * buf,
unsigned int len )
throw ( Exception ) | read |
[virtual]
Read from the OssDspSource. Puts the OSS DSP device into recording mode.
Parameters:
| buf | the buffer to read into. |
| len | the number of bytes to read into buf |
Returns: the number of bytes read (may be less than len).
Throws: Exception
Reimplemented from Source.
| void
close ( void )
throw ( Exception ) | close |
[virtual]
Close the OssDspSource.
Throws: Exception
Reimplemented from Source.