AprilAsr
Public Member Functions | List of all members
AprilAsr.AprilSession Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AprilSession()

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.

Parameters
modelThe model to use for the session.
callbackThe callback to call with decoded results.
asyncWhether or not to run the session asynchronously (perform calculations in background thread)
noRTWhether or not to run the session non-realtime if async is true. Has no effect if async is false.
speakerNameUnique name if there is one specific speaker. This is not yet implemented and has no effect.

Member Function Documentation

◆ FeedPCM16()

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.

◆ Flush()

void AprilAsr.AprilSession.Flush ( )

Flush any remaining samples and force the session to produce a final result.

◆ GetRTSpeedup()

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.


The documentation for this class was generated from the following file: