AprilAsr
|
The session is what performs the actual speech recognition. It has methods to input audio, and it calls your given handler with decoded results. More...
Public Member Functions | |
AprilSession (AprilModel model, SessionCallback callback, bool async=false, bool noRT=false, string speakerName="") | |
Construct a session with the given session, callback and options. More... | |
void | FeedPCM16 (short[] samples, int num_samples) |
Feed the given pcm16 samples in bytes to the session. If the session is asynchronous, this will return immediately and queue the data for the background thread to process. If the session is not asynchronous, this will block your thread and potentially call the handler before returning. More... | |
float | GetRTSpeedup () |
If the session is asynchronous and realtime, this will return a positive float. A value below 1.0 means the session is keeping up, and a value greater than 1.0 means the input audio is being sped up by that factor in order to keep up. When the value is greater 1.0, the accuracy is likely to be affected. More... | |
void | Flush () |
Flush any remaining samples and force the session to produce a final result. More... | |
The session is what performs the actual speech recognition. It has methods to input audio, and it calls your given handler with decoded results.
You need to pass a Model when constructing a Session.
AprilAsr.AprilSession.AprilSession | ( | AprilModel | model, |
SessionCallback | callback, | ||
bool | async = false , |
||
bool | noRT = false , |
||
string | speakerName = "" |
||
) |
Construct a session with the given session, callback and options.
model | The model to use for the session. |
callback | The callback to call with decoded results. |
async | Whether or not to run the session asynchronously (perform calculations in background thread) |
noRT | Whether or not to run the session non-realtime if async is true. Has no effect if async is false. |
speakerName | Unique name if there is one specific speaker. This is not yet implemented and has no effect. |
void AprilAsr.AprilSession.FeedPCM16 | ( | short[] | samples, |
int | num_samples | ||
) |
Feed the given pcm16 samples in bytes to the session. If the session is asynchronous, this will return immediately and queue the data for the background thread to process. If the session is not asynchronous, this will block your thread and potentially call the handler before returning.
void AprilAsr.AprilSession.Flush | ( | ) |
Flush any remaining samples and force the session to produce a final result.
float AprilAsr.AprilSession.GetRTSpeedup | ( | ) |
If the session is asynchronous and realtime, this will return a positive float. A value below 1.0 means the session is keeping up, and a value greater than 1.0 means the input audio is being sped up by that factor in order to keep up. When the value is greater 1.0, the accuracy is likely to be affected.