]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add some spec to speex
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 May 2007 23:53:21 +0000 (23:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 May 2007 23:53:21 +0000 (23:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5159 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/codecs/mod_speex/mod_speex.c

index 29dae4e66901e6fafb3f7fee530f9ff6c2a319d4..d4b46874fb43832fb4990e5b3a8965fc008a9a3b 100644 (file)
@@ -302,7 +302,73 @@ static const switch_codec_implementation_t speex_16k_implementation = {
        /*.next */ &speex_32k_implementation
 };
 
-static const switch_codec_implementation_t speex_8k_implementation = {
+
+static const switch_codec_implementation_t speex_8k_60ms_implementation = {
+       /*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
+       /*.ianacode */ 98,
+       /*.iananame */ "speex",
+       /*.fmtp */ NULL,
+       /*.samples_per_second */ 8000,
+       /*.bits_per_second */ 3300,
+       /*.nanoseconds_per_frame */ 60000,
+       /*.samples_per_frame */ 480,
+       /*.bytes_per_frame */ 960,
+       /*.encoded_bytes_per_frame */ 0,
+       /*.number_of_channels */ 1,
+       /*.pref_frames_per_packet */ 1,
+       /*.max_frames_per_packet */ 1,
+       /*.init */ switch_speex_init,
+       /*.encode */ switch_speex_encode,
+       /*.decode */ switch_speex_decode,
+       /*.destroy */ switch_speex_destroy,
+       /*.next */ &speex_16k_implementation
+};
+
+static const switch_codec_implementation_t speex_8k_40ms_implementation = {
+       /*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
+       /*.ianacode */ 98,
+       /*.iananame */ "speex",
+       /*.fmtp */ NULL,
+       /*.samples_per_second */ 8000,
+       /*.bits_per_second */ 22000,
+       /*.nanoseconds_per_frame */ 40000,
+       /*.samples_per_frame */ 240,
+       /*.bytes_per_frame */ 640,
+       /*.encoded_bytes_per_frame */ 0,
+       /*.number_of_channels */ 1,
+       /*.pref_frames_per_packet */ 1,
+       /*.max_frames_per_packet */ 1,
+       /*.init */ switch_speex_init,
+       /*.encode */ switch_speex_encode,
+       /*.decode */ switch_speex_decode,
+       /*.destroy */ switch_speex_destroy,
+       /*.next */ &speex_8k_60ms_implementation
+
+};
+
+
+static const switch_codec_implementation_t speex_8k_30ms_implementation = {
+       /*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
+       /*.ianacode */ 98,
+       /*.iananame */ "speex",
+       /*.fmtp */ NULL,
+       /*.samples_per_second */ 8000,
+       /*.bits_per_second */ 1650,
+       /*.nanoseconds_per_frame */ 30000,
+       /*.samples_per_frame */ 240,
+       /*.bytes_per_frame */ 480,
+       /*.encoded_bytes_per_frame */ 0,
+       /*.number_of_channels */ 1,
+       /*.pref_frames_per_packet */ 1,
+       /*.max_frames_per_packet */ 1,
+       /*.init */ switch_speex_init,
+       /*.encode */ switch_speex_encode,
+       /*.decode */ switch_speex_decode,
+       /*.destroy */ switch_speex_destroy,
+       /*.next */ &speex_8k_40ms_implementation
+};
+
+static const switch_codec_implementation_t speex_8k_20ms_implementation = {
        /*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
        /*.ianacode */ 98,
        /*.iananame */ "speex",
@@ -320,12 +386,12 @@ static const switch_codec_implementation_t speex_8k_implementation = {
        /*.encode */ switch_speex_encode,
        /*.decode */ switch_speex_decode,
        /*.destroy */ switch_speex_destroy,
-       /*.next */ &speex_16k_implementation
+       /*.next */ &speex_8k_30ms_implementation
 };
 
 static const switch_codec_interface_t speex_codec_interface = {
        /*.interface_name */ "speex",
-       /*.implementations */ &speex_8k_implementation
+       /*.implementations */ &speex_8k_20ms_implementation
 };
 
 static switch_loadable_module_interface_t speex_module_interface = {