Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

GapeAudioInput Class Reference

This class provides real time sound input (ie mic or line in). More...

#include <gapeaudioinput.h>

Inheritance diagram for GapeAudioInput::

GapeUnit List of all members.

Public Slots

virtual void receiveTick (const GapeFloat *values, int numValues)
 Gets samples from the sound card, then emits it for any Units hooked up after it. More...

virtual void stop ()
virtual void start ()
virtual void setMute (bool b)
 Mutes the unit. More...

virtual void setNumChannels (int nc)
 We override this method, because we can not dynamically change the number of channels we are receivingor sending under most audio API's (ie directx, OSS). More...


Public Methods

 GapeAudioInput (GapeController *c=NULL, int numChannels=1, int device=-1)
 The constructor. More...

virtual ~GapeAudioInput ()

Protected Methods

void getMoreData ()

Protected Attributes

RtAudio* input
bool properlyInitialized
GapeIntSamplesoundBuffer
int soundBufferSize
int currentBufferPosition
bool properInitializationReportedFlag
int tickCounter
bool hasBeenMuted

Detailed Description

This class provides real time sound input (ie mic or line in).

Its capabilities (ie channels and sample rates supported) are largely dependant on your sound card.

Author:
Dave Chisholm
Since:
Beta 1.0
Version:
Last Modified Beta 1.0

Definition at line 16 of file gapeaudioinput.h.


Constructor & Destructor Documentation

GapeAudioInput::GapeAudioInput ( GapeController * c = NULL,
int numChannels = 1,
int device = -1 )
 

The constructor.

Parameters:
c   An optional graphical controller.
numChannels   The amount of input channels to request. If this is more than your sound card can handle, the class will write an error to the log, and no sound will play, but should not cause other problems.
device   This is for support of computers with multiple audio cards. To use default card, omit parameter or pass -1.

Definition at line 6 of file gapeaudioinput.cpp.


Member Function Documentation

void GapeAudioInput::receiveTick ( const GapeFloat * values,
int numValues ) [virtual, slot]
 

Gets samples from the sound card, then emits it for any Units hooked up after it.

Will either mix input data from the card with incoming sample, or if it receives a null sample as a parameter, will act as a generator.

Parameters:
values   The sample.
numValues   The number of channels - if this is not what we expect, things are handled as follows. If more than we expect, we mix our channels with as many channels as needed, and leave the extra unchanged, and then send out all of them. If fewer channels than we expect, we expand the incoming sample by adding channels with 0 data, mix ours in, and send out all of them.

Reimplemented from GapeUnit.

Definition at line 70 of file gapeaudioinput.cpp.

void GapeAudioInput::setMute ( bool b ) [virtual, slot]
 

Mutes the unit.

Parameters:
b   true to mute, false to unmute

Reimplemented from GapeUnit.

Definition at line 37 of file gapeaudioinput.cpp.

void GapeAudioInput::setNumChannels ( int nc ) [inline, virtual, slot]
 

We override this method, because we can not dynamically change the number of channels we are receivingor sending under most audio API's (ie directx, OSS).

You'll need to construct a new object in this case to change num channels

Reimplemented from GapeUnit.

Definition at line 49 of file gapeaudioinput.h.


The documentation for this class was generated from the following files:
Generated at Thu Jun 21 13:28:50 2001 for GAPE by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001