C API for speaker diarization (#1402)

This commit is contained in:
Fangjun Kuang
2024-10-09 17:10:03 +08:00
committed by GitHub
parent 8535b1d3bb
commit d468527f62
9 changed files with 418 additions and 7 deletions

View File

@@ -20,8 +20,8 @@ struct FastClusteringConfig {
// distance threshold.
//
// The lower, the more clusters it will generate.
// The higher, the fewer clusters it will generate.
// The smaller, the more clusters it will generate.
// The larger, the fewer clusters it will generate.
float threshold = 0.5;
FastClusteringConfig() = default;

View File

@@ -43,6 +43,16 @@ bool OfflineSpeakerDiarizationConfig::Validate() const {
return false;
}
if (min_duration_on < 0) {
SHERPA_ONNX_LOGE("min_duration_on %.3f is negative", min_duration_on);
return false;
}
if (min_duration_off < 0) {
SHERPA_ONNX_LOGE("min_duration_off %.3f is negative", min_duration_off);
return false;
}
return true;
}

View File

@@ -7,7 +7,7 @@
#include "sherpa-onnx/csrc/wave-reader.h"
static int32_t ProgressCallback(int32_t processed_chunks, int32_t num_chunks,
void *arg) {
void *) {
float progress = 100.0 * processed_chunks / num_chunks;
fprintf(stderr, "progress %.2f%%\n", progress);