C++ API for speaker diarization (#1396)

This commit is contained in:
Fangjun Kuang
2024-10-09 12:01:20 +08:00
committed by GitHub
parent 70165cb42d
commit 59407edcad
39 changed files with 1652 additions and 108 deletions

View File

@@ -9,14 +9,15 @@
#include "sherpa-onnx/csrc/parse-options.h"
#include "sherpa-onnx/csrc/wave-writer.h"
int32_t audioCallback(const float * /*samples*/, int32_t n, float progress) {
static int32_t AudioCallback(const float * /*samples*/, int32_t n,
float progress) {
printf("sample=%d, progress=%f\n", n, progress);
return 1;
}
int main(int32_t argc, char *argv[]) {
const char *kUsageMessage = R"usage(
Offline text-to-speech with sherpa-onnx
Offline/Non-streaming text-to-speech with sherpa-onnx
Usage example:
@@ -79,7 +80,7 @@ or details.
sherpa_onnx::OfflineTts tts(config);
const auto begin = std::chrono::steady_clock::now();
auto audio = tts.Generate(po.GetArg(1), sid, 1.0, audioCallback);
auto audio = tts.Generate(po.GetArg(1), sid, 1.0, AudioCallback);
const auto end = std::chrono::steady_clock::now();
if (audio.samples.empty()) {