Cheetah Speech-to-Text
.NET API
API Reference for the .NET Cheetah SDK (NuGet)
namespace: Pv
Cheetah
Class for the Cheetah Speech-to-Text engine.
Cheetah.Create()
Cheetah
constructor.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console.modelPath
string : Absolute path to the file containing model parameters (.pv
).endpointDurationSec
float : Duration of endpoint in seconds. A speech endpoint is detected when there is a chunk of audio (with a duration specified herein) after an utterance without any speech in it. Set duration to 0 to disable this. Default is 1 second in the Builder.enableAutomaticPunctuation
bool : Enable automatic punctuation. Default is false.
Returns
Cheetah
: An instance of Cheetah Speech-To-Text engine.
Throws
CheetahException
: If an error occurs while creating an instance of the Cheetah Speech-to-Text engine.
Cheetah.Process()
Processes a frame of audio and returns newly-transcribed text and a flag indicating if an endpoint has been detected.
Upon detection of an endpoint, the client may invoke .Flush()
to retrieve any remaining
transcription.
The number of samples per frame can be attained by calling .FrameLength
. The incoming
audio needs to have a sample rate equal to .SampleRate
and be 16-bit linearly-encoded.
Furthermore, Cheetah
operates on single-channel audio.
Parameters
pcm
short[] : A frame of audio samples.
Returns
CheetahTranscript
: Inferred transcription object.
Throws
CheetahException
: if there is an error while processing the audio frame.
Cheetah.Flush()
Processes any remaining audio data and returns its transcription.
Returns
CheetahTranscript
: Inferred transcription object.
Throws
CheetahException
: If there is an error while processing the audio frame.
Cheetah.FrameLength
Getter for number of audio samples per frame.
Returns
int
: Number of audio samples per frame.
Cheetah.SampleRate
Getter for audio sample rate accepted by Picovoice.
Returns
int
: Audio sample rate accepted by Picovoice.
Cheetah.Version
Getter for version.
Returns
string
: CurrentCheetah
version.
CheetahTranscript
Class that contains Cheetah transcript data.
CheetahTranscript.Transcript
Getter for transcript data.
Returns
string
: Inferred transcription.
CheetahTranscript.IsEndpoint
Getter for IsEndpoint
flag.
Returns
boolean
: Iftrue
,Cheetah
detected a speech endpoint.
CheetahException
Exception thrown if an error occurs within Cheetah
Speech-to-Text engine.
Exceptions: