mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-15 11:47:54 +00:00
Sync from bytedesk-private: update
This commit is contained in:
27
modules/python/vendors/FunASR/runtime/websocket/bin/microphone.cpp
vendored
Normal file
27
modules/python/vendors/FunASR/runtime/websocket/bin/microphone.cpp
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user