Sets a new value for a stream property.
- int LV_SRE_StreamSetParameter(HPORT hport, const char* StreamParameter, unsigned int StreamParameterValue)
The port's handle.
Stream parameter to change. See available Stream Properties.
Note that in version 10.5, this parameter changed from an int to a const char *, which was to optimize the code internally. This should have minimal effect on users, except to require a recompilation of any code linking to the API when making this transition. Specifically, the defines that can be used in this parameter value were changed in the definition to accommodate this.
New stream parameter value.
No errors; parameter changed correctly.
The input hport is not a valid one.
The operation failed because the port was shutting down.
The specified parameter does not exist.
An exception occurred while processing the request.
The streaming parameters set by this function are very important for the Engine to correctly determine when speech begins and ends, which in turn is important for getting accurate recognition. A common problem in a speech applications is that the Engine may cut off the start or end of an utterance if these settings are incorrect.
See our recommended Engine settings for some ideas of how to alter these settings for different types of applications.
- // Here, we set the sound format to the standard audio format,
- // defined in the header files as ULAW_8khz. The return value is used
- // to determine whether audio was successfully established.
- SpeechPortReturnValue = LV_SRE_StreamSetParameter(pStreamingUserData->PortHandle, STREAM_PARM_SOUND_FORMAT, audio_format);
- if (SpeechPortReturnValue != LV_SUCCESS)
- fprintf("LV_SRE_StreamSetParameter failed with %s\n",