Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os-example-mbed5-blinky by
baidu_speex_encoder.h
00001 // Copyright 2017 Baidu Inc. All Rights Reserved. 00002 // Author: tai xiurong (taixiurong@baidu.com) 00003 // 00004 // Description: 00005 00006 #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_RECORDER_BAIDU_OS_SPEEX_ENCODER_H 00007 #define BAIDU_IOT_TINYDU_IOT_OS_SRC_RECORDER_BAIDU_OS_SPEEX_ENCODER_H 00008 00009 #include "baidu_recorder.h" 00010 00011 namespace duer { 00012 00013 class SpeexEncoder: public Recorder::MiddleWare { 00014 00015 public: 00016 00017 SpeexEncoder(size_t buff_size, void* buff); 00018 SpeexEncoder(); 00019 00020 virtual ~SpeexEncoder(); 00021 00022 virtual int on_start(); 00023 00024 virtual int on_resume(); 00025 00026 virtual int on_data(const void* data, size_t size); 00027 00028 virtual int on_pause(); 00029 00030 virtual int on_stop(); 00031 00032 private: 00033 static void recorder_output_handler(void* ctx, char* data, int size, int flush); 00034 void* _buff; 00035 size_t _capacity; 00036 char* _data; 00037 size_t _size; 00038 void* _encoder_buffer; 00039 bool _valid_record; 00040 const int _min_valid_size = 512; 00041 }; 00042 }//duer 00043 00044 #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_RECORDER_BAIDU_OS_SPEEX_ENCODER_H
Generated on Tue Jul 12 2022 16:28:53 by
1.7.2
