csharpCheetah Platform — .NET API

API Reference for the .NET Cheetah SDK (NuGet)


namespace: Pv


Cheetah

public class Cheetah : IDisposable { }

Class for the Cheetah Speech-to-Text engine.


Cheetah.Create()

public static Cheetah Create(
string accessKey,
string modelPath = null,
float endpointDurationSec = 1.0f)

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.

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()

public string Process(short[] pcm)

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

Throws


Cheetah.Flush()

public CheetahTranscript Flush()

Processes any remaining audio data and returns its transcription.

Returns

Throws


Cheetah.FrameLength

public int FrameLength { get; private set; }

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

Cheetah.SampleRate

public int SampleRate { get; private set; }

Getter for audio sample rate accepted by Picovoice.

Returns

  • int: Audio sample rate accepted by Picovoice.

Cheetah.Version

public string Version { get; private set; }

Getter for version.

Returns


CheetahTranscript

public class CheetahTranscript { }

Class that contains Cheetah transcript data.


CheetahTranscript.Transcript

public string Transcript { get; private set; }

Getter for transcript data.

Returns

  • string: Inferred transcription.

CheetahTranscript.IsEndpoint

public string Transcript { get; private set; }

Getter for IsEndpoint flag.

Returns

  • boolean: If true, Cheetah detected a speech endpoint.

CheetahException

public class CheetahException : Exception

Exception thrown if an error occurs within Cheetah Speech-to-Text engine.

Exceptions:

public class CheetahActivationException : CheetahException { }
public class CheetahActivationLimitException : CheetahException { }
public class CheetahActivationRefusedException : CheetahException { }
public class CheetahActivationThrottledException : CheetahException { }
public class CheetahIOException : CheetahException { }
public class CheetahInvalidArgumentException : CheetahException { }
public class CheetahInvalidStateException : CheetahException { }
public class CheetahKeyException : CheetahException { }
public class CheetahMemoryException : CheetahException { }
public class CheetahRuntimeException : CheetahException { }
public class CheetahStopIterationException : CheetahException { }

Issue with this doc? Please let us know.