Apollo 10.0
自动驾驶开放平台
apollo::drivers::microphone::Respeaker类 参考

#include <respeaker.h>

apollo::drivers::microphone::Respeaker 的协作图:

Public 成员函数

 Respeaker ()
 
 ~Respeaker ()
 
void init (const std::shared_ptr< const MicrophoneConfig > &microphone_config)
 
void read_stream (int n_frames, char *buffer) const
 

详细描述

在文件 respeaker.h49 行定义.

构造及析构函数说明

◆ Respeaker()

apollo::drivers::microphone::Respeaker::Respeaker ( )
inline

在文件 respeaker.h61 行定义.

61{}

◆ ~Respeaker()

apollo::drivers::microphone::Respeaker::~Respeaker ( )

在文件 respeaker.cc72 行定义.

72{ Pa_Terminate(); }

成员函数说明

◆ init()

void apollo::drivers::microphone::Respeaker::init ( const std::shared_ptr< const MicrophoneConfig > &  microphone_config)

在文件 respeaker.cc73 行定义.

74 {
75 if (microphone_config->microphone_model() != MicrophoneConfig::RESPEAKER) {
76 AERROR << "Microphone driver only supports respeaker model in config file";
77 }
78 err = Pa_Initialize();
79 if (err != paNoError) {
80 Pa_Terminate();
81 report_error(err, "Pa_Initialize");
82 }
83
84 const PaDeviceIndex device_index = get_respeaker_index();
85 stream_ptr_.reset(new Stream());
86 stream_ptr_->init_stream(
87 microphone_config->sample_rate(), microphone_config->channel_type_size(),
88 microphone_config->chunk(), device_index,
89 get_format_from_width(microphone_config->sample_width()));
90}
#define AERROR
Definition log.h:44
void report_error(PaError err, const std::string &func_name)
Definition respeaker.cc:26

◆ read_stream()

void apollo::drivers::microphone::Respeaker::read_stream ( int  n_frames,
char *  buffer 
) const

在文件 respeaker.cc159 行定义.

159 {
160 stream_ptr_->read_stream(n_frames, buffer);
161}

该类的文档由以下文件生成: