/// <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(); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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); }