mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Merge pull request #8900 from ivandrofly/feature/voskdistate
Feature/voskdistate
This commit is contained in:
commit
ecaa9972f3
@ -69,7 +69,8 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
|||||||
_model = new Model(modelFileName);
|
_model = new Model(modelFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rec = new VoskRecognizer(_model, 16000.0f);
|
using (var rec = new VoskRecognizer(_model, 16000.0f))
|
||||||
|
{
|
||||||
rec.SetMaxAlternatives(0);
|
rec.SetMaxAlternatives(0);
|
||||||
rec.SetWords(true);
|
rec.SetWords(true);
|
||||||
var list = new List<ResultText>();
|
var list = new List<ResultText>();
|
||||||
@ -87,7 +88,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var res = rec.PartialResult();
|
_ = rec.PartialResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,6 +109,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
|||||||
|
|
||||||
return ResultListToText(list);
|
return ResultListToText(list);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static string ResultListToText(List<ResultText> list)
|
private static string ResultListToText(List<ResultText> list)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user