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/csrc/microphone.h
2025-05-31 21:48:41 +08:00

28 lines
615 B
C++

// sherpa-onnx/csrc/microphone.h
//
// Copyright (c) 2022-2023 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_MICROPHONE_H_
#define SHERPA_ONNX_CSRC_MICROPHONE_H_
#include "portaudio.h" // NOLINT
namespace sherpa_onnx {
class Microphone {
PaStream *stream = nullptr;
public:
Microphone();
~Microphone();
int GetDeviceCount() const;
int GetDefaultInputDevice() const;
void PrintDevices(int sel) const;
bool OpenDevice(int index, int sample_rate, int channel, PaStreamCallback cb, void* userdata);
void CloseDevice();
};
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_MICROPHONE_H_