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