This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex_bi_series-sherpa-onnx/sherpa-onnx/python/csrc/online-stream.cc
2023-02-19 19:36:03 +08:00

22 lines
618 B
C++

// sherpa-onnx/python/csrc/online-stream.cc
//
// Copyright (c) 2023 Xiaomi Corporation
#include "sherpa-onnx/python/csrc/online-stream.h"
#include "sherpa-onnx/csrc/online-stream.h"
namespace sherpa_onnx {
void PybindOnlineStream(py::module *m) {
using PyClass = OnlineStream;
py::class_<PyClass>(*m, "OnlineStream")
.def("accept_waveform",
[](PyClass &self, float sample_rate, py::array_t<float> waveform) {
self.AcceptWaveform(sample_rate, waveform.data(), waveform.size());
})
.def("input_finished", &PyClass::InputFinished);
}
} // namespace sherpa_onnx