int sm_add_input_tone_set(struct sm_input_tone_set_parms *tonesetp)
typedef struct sm_input_tone_set_parms { tSMModuleId module; /* in */ tSM_INT band1_first_freq_coeffs_id; /* in */ tSM_INT band1_freq_count; /* in */ tSM_INT band2_first_freq_coeffs_id; /* in */ tSM_INT band2_freq_count; /* in */ double req_third_peak; /* in */ double req_signal_to_noise_ratio; /* in */ double req_minimum_power; /* in */ double req_twist_for_dual_tone; /* in */ tSM_INT id; /* out */ } SM_INPUT_TONE_SET_PARMS;
This call may be used to define an additional set of simple input tones (recognisable on any input channel) for the specified module module.
The new set of input tones is defined with respect to two sets of possible component frequencies, band 1 and band 2, and various other parameters req_third_peak, req_signal_to_noise_ratio, req_minimum_power and req_twist_for_dual_tone.
Band 1 is comprised of band1_freq_count coefficients whose ids range from: band1_first_freq_coeffs_id to band1_first_freq_coeffs_id + band1_freq_count - 1
Similarly Band 2 is comprised of band2_freq_count coefficients whose ids range from: band2_first_freq_coeffs_id to band2_first_freq_coeffs_id + band2_freq_count - 1
The new set of input tones will consist of all those tones that have a component frequency that is within the limits for a frequency coefficient pair taken from band 1, and another that is within the limits for a frequency coefficient pair taken from band 2.
For example, if band 1 was defined as the set of input frequency coefficient ids {0,1,2,3} and band 2 was defined as {4,5,6,7}, then the defined input tone set would be:
{ | <0,4>, | <0,5>, | <0,6>, | <0,7>, | |
<1,4>, | <1,5>, | <1,6>, | <1,7>, | ||
<2,4>, | <2,5>, | <2,6>, | <2,7>, | ||
<3,4>, | <3,5>, | <3,6>, | <3,7> | } |
On return id will be set to an identifier for the new set of input tones. This id may be used as a parameter to sm_listen_for() in order to specify the new set of input tones as those to be recognised on an input channel.
If single tones (as opposed to dual tones) are required to be detected, then either band1_freq_count or band2_freq_count should be set to zero. In this case the corresponding band1_first_freq_coeffs_id or band2_first_freq_coeffs_id is ignored.
See Prosody speech processing: pre-loaded input tones for list of predefined input frequency coefficient pairs, and for list of predefined input tone sets. See Prosody - Details of Tone Detection Algorithm for an explanation of the other parameters to this call.
0.1
indicates that the third frequency must
be no stronger than a tenth the power of the second frequency.
0.25
means that the detected signal must be more
than a quarter of the total received power.
10
means that the stronger must be no more than
ten times the power of the weaker.
0 if call completed successfully, otherwise a standard error such as:
This function is part of the Prosody speech processing API.