1
/* $Id: speex.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_CODEC_SPEEX_H__
21
#define __PJMEDIA_CODEC_SPEEX_H__
25
* @brief Speex codec header.
28
#include <pjmedia-codec/types.h>
31
* @defgroup PJMED_SPEEX Speex Codec Family
32
* @ingroup PJMEDIA_CODEC_CODECS
33
* @brief Implementation of Speex codecs (narrow/wide/ultrawide-band).
36
* This section describes functions to initialize and register speex codec
37
* factory to the codec manager. After the codec factory has been registered,
38
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
40
* The Speex codec uses multiple bit rates, and supports ultra-wideband
41
* (32 kHz sampling rate), wideband (16 kHz sampling rate) and narrowband
42
* (telephone quality, 8 kHz sampling rate)
44
* By default, the speex codec factory registers three Speex codecs:
45
* "speex/8000" narrowband codec, "speex/16000" wideband codec, and
46
* "speex/32000" ultra-wideband codec. This behavior can be changed by
47
* specifying #pjmedia_speex_options flags during initialization.
50
* \section codec_setting Codec Settings
52
* \subsection general_setting General Settings
54
* General codec settings for this codec such as VAD and PLC can be
55
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
56
* Please see the documentation of #pjmedia_codec_param for more info.
58
* \subsection specific_setting Codec Specific Settings
60
* The following settings are applicable for this codec.
62
* \subsubsection quality_vs_complexity Quality vs Complexity
64
* The Speex codec quality versus computational complexity and bandwidth
65
* requirement can be adjusted by modifying the quality and complexity
66
* setting, by calling #pjmedia_codec_speex_set_param(). The RFC 5574
67
* Section 5 shows the relationship between quality setting and the
70
* The default setting of quality is specified in
71
* #PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY. And the default setting of
72
* complexity is specified in #PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY.
79
* Bitmask options to be passed during Speex codec factory initialization.
81
enum pjmedia_speex_options
83
PJMEDIA_SPEEX_NO_NB = 1, /**< Disable narrowband mode. */
84
PJMEDIA_SPEEX_NO_WB = 2, /**< Disable wideband mode. */
85
PJMEDIA_SPEEX_NO_UWB = 4, /**< Disable ultra-wideband mode. */
90
* Initialize and register Speex codec factory to pjmedia endpoint.
92
* @param endpt The pjmedia endpoint.
93
* @param options Bitmask of pjmedia_speex_options (default=0).
94
* @param quality Specify encoding quality, or use -1 for default
95
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY).
96
* @param complexity Specify encoding complexity , or use -1 for default
97
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY).
99
* @return PJ_SUCCESS on success.
101
PJ_DECL(pj_status_t) pjmedia_codec_speex_init( pjmedia_endpt *endpt,
108
* Initialize Speex codec factory using default settings and register to
111
* @param endpt The pjmedia endpoint.
113
* @return PJ_SUCCESS on success.
115
PJ_DECL(pj_status_t) pjmedia_codec_speex_init_default(pjmedia_endpt *endpt);
119
* Change the settings of Speex codec.
121
* @param clock_rate Clock rate of Speex mode to be set.
122
* @param quality Specify encoding quality, or use -1 for default
123
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY).
124
* @param complexity Specify encoding complexity , or use -1 for default
125
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY).
127
* @return PJ_SUCCESS on success.
129
PJ_DECL(pj_status_t) pjmedia_codec_speex_set_param(unsigned clock_rate,
135
* Unregister Speex codec factory from pjmedia endpoint and deinitialize
136
* the Speex codec library.
138
* @return PJ_SUCCESS on success.
140
PJ_DECL(pj_status_t) pjmedia_codec_speex_deinit(void);
149
#endif /* __PJMEDIA_CODEC_SPEEX_H__ */