Files
FunASR/runtime/websocket/bin/microphone.cpp
T
freedakgmail 6116b1f3c6
Update API Documentation / build-api-docs (push) Has been cancelled
Initial commit: FunASR Speech Recognition Toolkit
Add complete FunASR codebase including models, runtime, and documentation.
2026-07-09 22:38:58 +08:00

28 lines
589 B
C++

/**
* Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights
* Reserved. MIT License (https://opensource.org/licenses/MIT)
*/
#include "microphone.h"
#include <stdio.h>
#include <stdlib.h>
#include "portaudio.h" // NOLINT
Microphone::Microphone() {
PaError err = Pa_Initialize();
if (err != paNoError) {
LOG(ERROR)<<"portaudio error: " << Pa_GetErrorText(err);
exit(-1);
}
}
Microphone::~Microphone() {
PaError err = Pa_Terminate();
if (err != paNoError) {
LOG(ERROR)<<"portaudio error: " << Pa_GetErrorText(err);
exit(-1);
}
}