Add Swift example for generating subtitles (#318)
This commit is contained in:
@@ -18,9 +18,9 @@ void Hypotheses::Add(Hypothesis hyp) {
|
||||
} else {
|
||||
it->second.log_prob = LogAdd<double>()(it->second.log_prob, hyp.log_prob);
|
||||
|
||||
if (it->second.lm_log_prob != 0 && hyp.lm_log_prob != 0){
|
||||
if (it->second.lm_log_prob != 0 && hyp.lm_log_prob != 0) {
|
||||
it->second.lm_log_prob =
|
||||
LogAdd<double>()(it->second.lm_log_prob, hyp.lm_log_prob);
|
||||
LogAdd<double>()(it->second.lm_log_prob, hyp.lm_log_prob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ struct SileroVadModelConfig {
|
||||
|
||||
// threshold to classify a segment as speech
|
||||
//
|
||||
// The predicted probability of a segment is larger than this
|
||||
// If the predicted probability of a segment is larger than this
|
||||
// value, then it is classified as speech.
|
||||
float threshold = 0.5;
|
||||
|
||||
@@ -25,7 +25,7 @@ struct SileroVadModelConfig {
|
||||
|
||||
// 512, 1024, 1536 samples for 16000 Hz
|
||||
// 256, 512, 768 samples for 800 Hz
|
||||
int window_size = 512; // in samples
|
||||
int32_t window_size = 512; // in samples
|
||||
|
||||
SileroVadModelConfig() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user