Changeset 653 for pjproject/trunk/pjmedia/include/pjmedia/echo.h
- Timestamp:
- Aug 6, 2006 12:07:13 PM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/echo.h
r652 r653 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJMEDIA_ AEC_H__20 #define __PJMEDIA_ AEC_H__19 #ifndef __PJMEDIA_ECHO_H__ 20 #define __PJMEDIA_ECHO_H__ 21 21 22 22 23 23 /** 24 * @file aec.h25 * @brief AEC (Accoustic Echo Cancellation)API.24 * @file echo.h 25 * @brief Echo Cancellation API. 26 26 */ 27 27 #include <pjmedia/types.h> … … 30 30 31 31 /** 32 * @defgroup PJMEDIA_ AEC AEC AEC (Accoustic Echo Cancellation)32 * @defgroup PJMEDIA_Echo_Cancel Canceller Echo Cancellation 33 33 * @ingroup PJMEDIA_PORT 34 * @brief AEC (Accoustic Echo Cancellation)API.34 * @brief Echo Cancellation API. 35 35 * @{ 36 * 37 * This section describes API to perform echo cancellation to audio signal. 38 * There may be multiple echo canceller implementation in PJMEDIA, ranging 39 * from simple echo suppressor to a full Accoustic Echo Canceller/AEC. By 40 * using this API, application should be able to use which EC backend to 41 * use base on the requirement and capability of the platform. 36 42 */ 37 43 … … 41 47 42 48 /** 43 * Opaque type for PJMEDIA AEC.49 * Opaque type for PJMEDIA Echo Canceller state. 44 50 */ 45 typedef struct pjmedia_ aec pjmedia_aec;51 typedef struct pjmedia_echo_state pjmedia_echo_state; 46 52 47 53 48 54 /** 49 * Create the AEC. 55 * Echo cancellation options. 56 */ 57 typedef enum pjmedia_echo_flag 58 { 59 /** 60 * If PJMEDIA_ECHO_SIMPLE flag is specified during echo canceller 61 * creation, then a simple echo suppressor will be used instead of 62 * an accoustic echo cancellation. 63 */ 64 PJMEDIA_ECHO_SIMPLE = 1, 65 66 /** 67 * If PJMEDIA_ECHO_NO_LOCK flag is specified, no mutex will be created 68 * for the echo canceller, but application will guarantee that echo 69 * canceller will not be called by different threads at the same time. 70 */ 71 PJMEDIA_ECHO_NO_LOCK = 2 72 73 } pjmedia_echo_flag; 74 75 76 77 78 /** 79 * Create the echo canceller. 50 80 * 51 81 * @param pool Pool to allocate memory. … … 53 83 * @param samples_per_frame Number of samples per frame. 54 84 * @param tail_ms Tail length, miliseconds. 85 * @param options Options. If PJMEDIA_ECHO_SIMPLE is specified, 86 * then a simple echo suppressor implementation 87 * will be used instead of an accoustic echo 88 * cancellation. 89 * See #pjmedia_echo_flag for other options. 90 * @param p_echo Pointer to receive the Echo Canceller state. 55 91 * 56 * @return PJ_SUCCESS on success .92 * @return PJ_SUCCESS on success, or the appropriate status. 57 93 */ 58 PJ_DECL(pj_status_t) pjmedia_ aec_create(pj_pool_t *pool,94 PJ_DECL(pj_status_t) pjmedia_echo_create(pj_pool_t *pool, 59 95 unsigned clock_rate, 60 96 unsigned samples_per_frame, 61 97 unsigned tail_ms, 62 98 unsigned options, 63 pjmedia_ aec **p_aec);99 pjmedia_echo_state **p_echo ); 64 100 65 101 66 102 /** 67 * Destroy the AEC.103 * Destroy the Echo Canceller. 68 104 * 69 * @param aec The AEC. 105 * @param echo The Echo Canceller. 106 * 70 107 * @return PJ_SUCCESS on success. 71 108 */ 72 PJ_DECL(pj_status_t) pjmedia_ aec_destroy(pjmedia_aec *aec);109 PJ_DECL(pj_status_t) pjmedia_echo_destroy(pjmedia_echo_state *echo ); 73 110 74 111 75 112 /** 76 * Let the AECknows that a frame has been played to the speaker.77 * The AECwill keep the frame in its internal buffer, to be used78 * when cancelling the echo with #pjmedia_ aec_capture().113 * Let the Echo Canceller knows that a frame has been played to the speaker. 114 * The Echo Canceller will keep the frame in its internal buffer, to be used 115 * when cancelling the echo with #pjmedia_echo_capture(). 79 116 * 80 * @param aec The AEC. 81 * @param ts Optional timestamp to let the AEC knows the 82 * position of the frame relative to capture 83 * position. If NULL, the AEC assumes that 84 * application will supply the AEC with continuously 85 * increasing timestamp. 117 * @param echo The Echo Canceller. 86 118 * @param play_frm Sample buffer containing frame to be played 87 119 * (or has been played) to the playback device. … … 91 123 * @return PJ_SUCCESS on success. 92 124 */ 93 PJ_DECL(pj_status_t) pjmedia_ aec_playback( pjmedia_aec *aec,125 PJ_DECL(pj_status_t) pjmedia_echo_playback(pjmedia_echo_state *echo, 94 126 pj_int16_t *play_frm ); 95 127 96 128 97 129 /** 98 * Let the AEC knows that a frame has been captured from the microphone. 99 * The AEC will cancel the echo from the captured signal, using the 100 * internal buffer (supplied by #pjmedia_aec_playback()) as the 101 * FES (Far End Speech) reference. 130 * Let the Echo Canceller knows that a frame has been captured from 131 * the microphone. 132 * The Echo Canceller will cancel the echo from the captured signal, 133 * using the internal buffer (supplied by #pjmedia_echo_playback()) 134 * as the FES (Far End Speech) reference. 102 135 * 103 * @param aec The AEC.136 * @param echo The Echo Canceller. 104 137 * @param rec_frm On input, it contains the input signal (captured 105 138 * from microphone) which echo is to be removed. … … 113 146 * @return PJ_SUCCESS on success. 114 147 */ 115 PJ_DECL(pj_status_t) pjmedia_ aec_capture( pjmedia_aec *aec,148 PJ_DECL(pj_status_t) pjmedia_echo_capture(pjmedia_echo_state *echo, 116 149 pj_int16_t *rec_frm, 117 150 unsigned options ); … … 121 154 * Perform echo cancellation. 122 155 * 123 * @param aec The AEC.156 * @param echo The Echo Canceller. 124 157 * @param rec_frm On input, it contains the input signal (captured 125 158 * from microphone) which echo is to be removed. … … 136 169 * @return PJ_SUCCESS on success. 137 170 */ 138 PJ_DECL(pj_status_t) pjmedia_ aec_cancel_echo( pjmedia_aec *aec,139 140 141 142 171 PJ_DECL(pj_status_t) pjmedia_echo_cancel( pjmedia_echo_state *echo, 172 pj_int16_t *rec_frm, 173 const pj_int16_t *play_frm, 174 unsigned options, 175 void *reserved ); 143 176 144 177 … … 150 183 151 184 152 #endif /* __PJMEDIA_ AEC_H__ */185 #endif /* __PJMEDIA_ECHO_H__ */ 153 186
Note: See TracChangeset
for help on using the changeset viewer.