Prosody speech processing: API: sm_adjust_input_tone_set

Prototype Definition

int sm_adjust_input_tone_set(struct sm_adjust_tone_set_parms *tonesetp)

Parameters

*tonesetp
a structure of the following type:
typedef struct sm_adjust_tone_set_parms {
	tSMModuleId module;					/* in */
	tSM_INT tone_set_id;					/* in */
	enum kAdjustToneSet {
		kAdjustToneSetFPParamId3rdPeak,
		kAdjustToneSetFPParamIdSNRatio,
		kAdjustToneSetFPParamIdMinPower,
		kAdjustToneSetFPParamIdTwist,
		kAdjustToneSetIntParamIdMinOnTime,
		kAdjustToneSetIntParamIdMinOffTime,
		kAdjustToneSetFPParamIdStartFreq,
		kAdjustToneSetFPParamIdStopFreq,
	} parameter_id;						/* in */
	union {
		double fp_value;				/* in */
		tSM_INT int_value;				/* in */
	} parameter_value;					/* in */
} SM_ADJUST_TONE_SET_PARMS;

Description

This call may be used to alter the tone detection characteristics of a pre-loaded or user defined (through sm_add_input_tone_set()) input tone set for the specified module module.

The tone set to be modified is identified through the tone_set_id parameter, this must either be the identifier for one of the pre-loaded input tone sets (see Prosody speech processing: pre-loaded input tones), or an identifier returned by sm_add_input_tone_set().

Invoking the call will change a single input tone set parameter, that parameter being identified by the value supplied parameter_id.

The new parameter value must be set in either the fp_value or int_value element of the parameter_value union according to the parameter type.

See Prosody - Details of Tone Detection Algorithm for more details on how adjusting these input tone set parameters affects tone recognition.

In previous versions, the values of kAdjustToneSetIntParamIdMinOnTime and kAdjustToneSetIntParamIdMinOffTime were not independent, that is setting one value also set the other. These values are now independent. However, if only one value is >= 64 then that value is used for both the on and off times in order to retain compatibility with applications that only set one value.

For firmware versions where the on and off times are not independent, the kAdjustToneSetIntParamIdMinOnTime is used (subject the the above compatibility constraint).

Fields

module
The module containing the tone set to be adjusted.
tone_set_id
The tone set to adjust.
parameter_id
An indicator of which parameter to adjust. One of these values:
kAdjustToneSetFPParamId3rdPeak
The value initially set by the req_third_peak field of sm_add_input_tone_set() is replaced with the value of the fp_value field.
kAdjustToneSetFPParamIdSNRatio
The value initially set by the req_signal_to_noise_ratio field of sm_add_input_tone_set() is replaced with the value of the fp_value field.
kAdjustToneSetFPParamIdMinPower
The value initially set by the req_minimum_power field of sm_add_input_tone_set() is replaced with the value of the fp_value field.
kAdjustToneSetFPParamIdTwist
The value initially set by the req_twist_for_dual_tone field of sm_add_input_tone_set() is replaced with the value of the fp_value field.
kAdjustToneSetIntParamIdMinOnTime
The minimum time (in mS, >= 64) for which a tone must persist before it is considered to be valid is set to the value of the int_value field. This value is used to increase the minimum tone duration when the tone detection mode is kSMToneDetectionMinDuration64 or another of the ...MinDuration64 detection modes.
kAdjustToneSetIntParamIdMinOffTime
The minimum time (in mS, >= 64) for which a tone must cease before it is considered to have ended is set to the value of the int_value field. This value is used to increase the minimum silence duration when the tone detection mode is kSMToneDetectionMinDuration64 or another of the ...MinDuration64 detection modes.
kAdjustToneSetFPParamIdStartFreq
The minimum frequency to consider when listening for tones. Any signal at a lower frequency will be ignored (even when checking signal to noise ratio). The value (in Hz) is specified in the fp_value field.
kAdjustToneSetFPParamIdStopFreq
The maximum frequency to consider when listening for tones. Any signal at a higher frequency will be ignored (even when checking signal to noise ratio). The value (in Hz) is specified in the fp_value field.
parameter_value
The parameter value.
fp_value
A floating point parameter value.
int_value
An integer parameter value.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody speech processing API.