|
|
An audio input based on Solaris /dev/audio devices
char * fileName | fileName |
[private]
int fileDescriptor | fileDescriptor |
[private]
bool running | running |
[private]
inline
SolarisDspSource ( void )
throw ( Exception ) | SolarisDspSource |
[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 Solaris DSP device. |
Throws: Exception
Reimplemented from AudioSource.
void
strip ( void )
throw ( Exception ) | strip |
[protected]
De-iitialize the object
Throws: Exception
Reimplemented from AudioSource.
inline
SolarisDspSource ( const char * name,
int sampleRate = 44100,
int bitsPerSample = 16,
int channel = 2 )
throw ( Exception ) | SolarisDspSource |
Constructor.
Parameters:
name | the file name of the Solaris DSP device (e.g. /dev/audio or /dev/sound/0) |
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
SolarisDspSource ( const SolarisDspSource & ds )
throw ( Exception ) | SolarisDspSource |
Copy Constructor.
Parameters:
source | the object to copy. |
Throws: Exception
inline
~SolarisDspSource ( void )
throw ( Exception ) | ~SolarisDspSource |
[virtual]
Destructor.
Throws: Exception
inline SolarisDspSource &
operator= ( const SolarisDspSource & 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.
inline bool
isBigEndian ( void )
throw () | isBigEndian |
[const virtual]
Tell if the data from this source comes in big or little endian.
Returns: true
Reimplemented from AudioSource.
bool
open ( void )
throw ( Exception ) | open |
[virtual]
Open the SolarisDspSource. This does not put the Solaris 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 SolarisDspSource is open.
Returns: true if the SolarisDspSource is open, false otherwise.
Reimplemented from Source.
bool
canRead ( unsigned int sec,
unsigned int usec )
throw ( Exception ) | canRead |
[virtual]
Check if the SolarisDspSource can be read from. Blocks until the specified time for data to be available. Puts the Solaris 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 SolarisDspSource 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 SolarisDspSource. Puts the Solaris 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 SolarisDspSource.
Throws: Exception
Reimplemented from Source.