From 969b2ac4ba45aaf940a6371cfa73a34e38cab24f Mon Sep 17 00:00:00 2001 From: dabinat Date: Fri, 14 Feb 2020 19:14:08 -0800 Subject: [PATCH] Changed variable names to match coding style --- native_client/deepspeech.cc | 12 ++++++------ native_client/deepspeech.h | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/native_client/deepspeech.cc b/native_client/deepspeech.cc index 839a0122..c44e130b 100644 --- a/native_client/deepspeech.cc +++ b/native_client/deepspeech.cc @@ -80,7 +80,7 @@ struct StreamingState { char* intermediateDecode() const; void finalizeStream(); char* finishStream(); - Result* finishStreamWithMetadata(unsigned int numResults); + Result* finishStreamWithMetadata(unsigned int num_results); void processAudioWindow(const vector& buf); void processMfccWindow(const vector& buf); @@ -144,7 +144,7 @@ StreamingState::finishStream() } Result* -StreamingState::finishStreamWithMetadata(unsigned int numResults) +StreamingState::finishStreamWithMetadata(unsigned int num_results) { finalizeStream(); @@ -427,9 +427,9 @@ DS_FinishStream(StreamingState* aSctx) Result* DS_FinishStreamWithMetadata(StreamingState* aSctx, - unsigned int numResults) + unsigned int aNumResults) { - Result* result = aSctx->finishStreamWithMetadata(numResults); + Result* result = aSctx->finishStreamWithMetadata(aNumResults); DS_FreeStream(aSctx); return result; } @@ -461,10 +461,10 @@ Result* DS_SpeechToTextWithMetadata(ModelState* aCtx, const short* aBuffer, unsigned int aBufferSize, - unsigned int numResults) + unsigned int aNumResults) { StreamingState* ctx = CreateStreamAndFeedAudioContent(aCtx, aBuffer, aBufferSize); - return DS_FinishStreamWithMetadata(ctx, numResults); + return DS_FinishStreamWithMetadata(ctx, aNumResults); } void diff --git a/native_client/deepspeech.h b/native_client/deepspeech.h index 41d133ae..53f1954f 100644 --- a/native_client/deepspeech.h +++ b/native_client/deepspeech.h @@ -197,6 +197,7 @@ char* DS_SpeechToText(ModelState* aCtx, * @param aBuffer A 16-bit, mono raw audio signal at the appropriate * sample rate (matching what the model was trained on). * @param aBufferSize The number of samples in the audio signal. + * @param aNumResults The number of alternative transcriptions to return. * * @return Outputs a struct of individual letters along with their timing information. * The user is responsible for freeing Metadata by calling {@link DS_FreeMetadata()}. Returns NULL on error. @@ -205,7 +206,7 @@ DEEPSPEECH_EXPORT Result* DS_SpeechToTextWithMetadata(ModelState* aCtx, const short* aBuffer, unsigned int aBufferSize, - unsigned int numResults); + unsigned int aNumResults); /** * @brief Create a new streaming inference state. The streaming state returned @@ -265,6 +266,7 @@ char* DS_FinishStream(StreamingState* aSctx); * inference, returns per-letter metadata. * * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}. + * @param aNumResults The number of alternative transcriptions to return. * * @return Outputs a struct of individual letters along with their timing information. * The user is responsible for freeing Metadata by calling {@link DS_FreeMetadata()}. Returns NULL on error. @@ -273,7 +275,7 @@ char* DS_FinishStream(StreamingState* aSctx); */ DEEPSPEECH_EXPORT Result* DS_FinishStreamWithMetadata(StreamingState* aSctx, - unsigned int numResults); + unsigned int aNumResults); /** * @brief Destroy a streaming state without decoding the computed logits. This