Ejemplo n.º 1
0
 /// <summary>
 /// Destroy a streaming state without decoding the computed logits.
 /// This can be used if you no longer need the result of an ongoing streaming
 /// inference and don't want to perform a costly decode operation.
 /// </summary>
 public unsafe void FreeStream(DeepSpeechStream stream)
 {
     NativeImp.DS_FreeStream(stream.GetNativePointer());
     stream.Dispose();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Computes the intermediate decoding of an ongoing streaming inference.
 /// </summary>
 /// <param name="stream">Instance of the stream to decode.</param>
 /// <returns>The STT intermediate result.</returns>
 public unsafe string IntermediateDecode(DeepSpeechStream stream)
 {
     return(NativeImp.DS_IntermediateDecode(stream.GetNativePointer()).PtrToString());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Closes the ongoing streaming inference, returns the STT result over the whole audio signal.
 /// </summary>
 /// <param name="stream">Instance of the stream to finish.</param>
 /// <returns>The STT result.</returns>
 public unsafe string FinishStream(DeepSpeechStream stream)
 {
     return(NativeImp.DS_FinishStream(stream.GetNativePointer()).PtrToString());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Closes the ongoing streaming inference, returns the STT result over the whole audio signal.
 /// </summary>
 /// <param name="stream">Instance of the stream to finish.</param>
 /// <returns>The extended metadata result.</returns>
 public unsafe Metadata FinishStreamWithMetadata(DeepSpeechStream stream)
 {
     return(NativeImp.DS_FinishStreamWithMetadata(stream.GetNativePointer()).PtrToMetadata());
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Feeds audio samples to an ongoing streaming inference.
 /// </summary>
 /// <param name="stream">Instance of the stream to feed the data.</param>
 /// <param name="aBuffer">An array of 16-bit, mono raw audio samples at the appropriate sample rate (matching what the model was trained on).</param>
 public unsafe void FeedAudioContent(DeepSpeechStream stream, short[] aBuffer, uint aBufferSize)
 {
     NativeImp.DS_FeedAudioContent(stream.GetNativePointer(), aBuffer, aBufferSize);
 }