Next Previous Contents

3. Microphone handler

3.1 Overview

rtMicrophoneHandler, inherited from rtDataHandler, is the main class for microphone handling. It is the only one that has to be instancied by programmers. Its work is to initialise the microphone, and codes incoming audio streams into the outgoing buffer of data handler.

Audio encoding is made by an instance of rtMicrophoneCoder that belongs to a rtMicrophoneHandler.

Please note that rtDataHandler standard block handling method is ignored and that the execute(void*) method is overloaded (since no incoming stream rtDataStream exists).

3.2 Sound encoding

First of all, rtMicrophoneCoder is doing a basic microphone calibration. When done, it enters in a normal audio encoding mode that consists in listening for noise, ignore silences except when they reflect a end of speech stream (EOS), and chain either sound blocks (ST_SOUND data stream block type) or EOS block (ST_EOS type).

3.3 Parameters

The silenceBlocksForEOS parameter contains the number of silences corresponding to the end of speech/stream information.

Others parameters handle microphone hard configuration : acqFrequency (in Hz, default 8000), sampleSize (is the basic word's number of bits), blockSize (depending on underlaying hardware, this is the byte number that are readen from device in a raw; commonly 64), and blockNumber is the number of raw device blocks that'll be in encoded a sound block buffer.


Next Previous Contents