Expose model sample rate in API
This commit is contained in:
parent
315a67bf69
commit
0241f725cd
@ -292,6 +292,12 @@ DS_CreateModel(const char* aModelPath,
|
|||||||
return DS_ERR_OK;
|
return DS_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
DS_GetModelSampleRate(ModelState* aCtx)
|
||||||
|
{
|
||||||
|
return aCtx->sample_rate_;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DS_FreeModel(ModelState* ctx)
|
DS_FreeModel(ModelState* ctx)
|
||||||
{
|
{
|
||||||
|
@ -92,6 +92,16 @@ int DS_CreateModel(const char* aModelPath,
|
|||||||
unsigned int aBeamWidth,
|
unsigned int aBeamWidth,
|
||||||
ModelState** retval);
|
ModelState** retval);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the sample rate expected by a model.
|
||||||
|
*
|
||||||
|
* @param aCtx A ModelState pointer created with {@link DS_CreateModel}.
|
||||||
|
*
|
||||||
|
* @return Sample rate expected by the model for its input.
|
||||||
|
*/
|
||||||
|
DEEPSPEECH_EXPORT
|
||||||
|
int DS_GetModelSampleRate(ModelState* aCtx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Frees associated resources and destroys model object.
|
* @brief Frees associated resources and destroys model object.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user