#include <MpSpeakerSelectBase.h>
Base class for all Speaker Selection (SS) algorithms.
To create concrete class you could directly instantiate it or use MpSpeakerSelectBase::createInstance() static method for greater flexibility.
virtual OsStatus init |
( |
int |
maxParticipants, |
|
|
int |
maxActive |
|
) |
| |
|
pure virtual |
Initialize SS to initial state.
- Parameters
-
[in] | maxParticipants | - maximum number of participants in a conference. |
[in] | maxActive | - maximum number of participants to be detected as active speech, -1 lead to no constrains. Correct setting of maxActive helps SS algorithm to minimize number of flips between least ranked speaker inside maxActive speakers and most ranked speaker outside of this number. |
Should be called before any other class methods. All participants after initialization are disabled, to enable it call enableParticipant().
Factory method for SS algorithms creation.
- Parameters
-
[in] | name | - name of SS algorithm to use. Use empty string to get default algorithm. |
- Note
- To date we have no available SS algorithms in open-source, so NULL is always returned.
- Returns
- If appropriate SS algorithm is not found, default one is returned.
Reset algorithm state to initial and prepare for processing of new data.
It's supposed that init() will not be called after reset(). So reset() must turn algorithm to the state as right after calling init(). Maximum number of participants intentionally is not changed, to prevent memory reallocation.
virtual OsStatus enableParticipant |
( |
int |
num, |
|
|
UtlBoolean |
newState |
|
) |
| |
|
pure virtual |
Enable/disable processing of a selected participant.
Initially all participants are disabled. Use this method to enable processing for newly added participants and disable processing for removed participants. Data from disabled participants are just ignored.
- Parameters
-
[in] | num | - number of participant, starting from zero |
[in] | newState | - pass TRUE to enable processing of this participant, FALSE to disable. |
- Return values
-
OS_SUCCESS | if participant is successfully enabled or disabled. |
OS_INVALID_ARGUMENT | if participant number refers to non existing participant. |
virtual OsStatus processFrame |
( |
MpSpeechParams * |
speechParams[], |
|
|
int |
frameSize |
|
) |
| |
|
pure virtual |
Compute speaker ranks.
- Parameters
-
[in] | speechParams | - parameters of bridges |
[in] | frameSize | - number of milliseconds in frame |
- Return values
-
OS_SUCCESS | if processing is ok. |
virtual OsStatus setParam |
( |
const char * |
paramName, |
|
|
void * |
value |
|
) |
| |
|
pure virtual |
Set algorithm parameter.
- Parameters
-
[in] | paramName | - name of parameter. |
[in] | value | - pointer to a value. |
- Return values
-
OS_SUCCESS | if parameter has been set. |
void setDefaultAlgorithm |
( |
const UtlString & |
name | ) |
|
|
static |
Set algorithm to be used by default.
Initially default algorithm is defined at compile time. Using this function you can change default algorithm at run-time or switch back to compile-time default.
- Parameters
-
[in] | name | - name of algorithm to use by default. Reverts to compile-time default if empty. |
virtual OsStatus isParticipantEnabled |
( |
int |
num, |
|
|
UtlBoolean & |
enabled |
|
) |
| |
|
pure virtual |
Is processing enabled for a given participant?
- Parameters
-
[in] | num | - number of a participant, starting from zero. |
[out] | enabled | - variable is set to TRUE processing of this participant is enabled, FALSE otherwise. |
- Return values
-
OS_SUCCESS | if value is returned. |
OS_INVALID_ARGUMENT | if participant number refers to non existing participant. |
UtlString smDefaultAlgorithm |
|
staticprotected |
Name of algorithm to be used by default.