Expose and use model sample rate in .NET
This commit is contained in:
parent
5cb15ca6ed
commit
4dc18dd8ee
@ -64,6 +64,15 @@ namespace DeepSpeechClient
|
|||||||
EvaluateResultCode(resultCode);
|
EvaluateResultCode(resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the sample rate expected by the model.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Sample rate.</returns>
|
||||||
|
public unsafe int GetModelSampleRate()
|
||||||
|
{
|
||||||
|
return NativeImp.DS_GetModelSampleRate(_modelStatePP);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Evaluate the result code and will raise an exception if necessary.
|
/// Evaluate the result code and will raise an exception if necessary.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -24,6 +24,12 @@ namespace DeepSpeechClient.Interfaces
|
|||||||
string aAlphabetConfigPath,
|
string aAlphabetConfigPath,
|
||||||
uint aBeamWidth);
|
uint aBeamWidth);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the sample rate expected by the model.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Sample rate.</returns>
|
||||||
|
unsafe int GetModelSampleRate();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enable decoding using beam scoring with a KenLM language model.
|
/// Enable decoding using beam scoring with a KenLM language model.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -20,6 +20,9 @@ namespace DeepSpeechClient
|
|||||||
uint aBeamWidth,
|
uint aBeamWidth,
|
||||||
ref IntPtr** pint);
|
ref IntPtr** pint);
|
||||||
|
|
||||||
|
[DllImport("libdeepspeech.so", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
internal unsafe static extern int DS_GetModelSampleRate(IntPtr** aCtx);
|
||||||
|
|
||||||
[DllImport("libdeepspeech.so", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("libdeepspeech.so", CallingConvention = CallingConvention.Cdecl)]
|
||||||
internal static unsafe extern ErrorCodes DS_EnableDecoderWithLM(IntPtr** aCtx,
|
internal static unsafe extern ErrorCodes DS_EnableDecoderWithLM(IntPtr** aCtx,
|
||||||
string aLMPath,
|
string aLMPath,
|
||||||
|
Loading…
Reference in New Issue
Block a user