2009-06-20 03:40:46 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Arsen Chaloyan
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some mandatory rules for plugin implementation.
|
|
|
|
* 1. Each plugin MUST contain the following function as an entry point of the plugin
|
|
|
|
* MRCP_PLUGIN_DECLARE(mrcp_resource_engine_t*) mrcp_plugin_create(apr_pool_t *pool)
|
|
|
|
* 2. One and only one response MUST be sent back to the received request.
|
|
|
|
* 3. Methods (callbacks) of the MRCP engine channel MUST not block.
|
|
|
|
* (asynch response can be sent from the context of other thread)
|
|
|
|
* 4. Methods (callbacks) of the MPF engine stream MUST not block.
|
|
|
|
*/
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
#include <pocketsphinx.h>
|
|
|
|
#include <apr_thread_cond.h>
|
|
|
|
#include <apr_thread_proc.h>
|
|
|
|
#include <apr_tables.h>
|
|
|
|
#include <apr_file_io.h>
|
2009-06-20 03:40:46 +00:00
|
|
|
#include "mrcp_resource_engine.h"
|
|
|
|
#include "mrcp_recog_resource.h"
|
|
|
|
#include "mrcp_recog_header.h"
|
|
|
|
#include "mrcp_generic_header.h"
|
|
|
|
#include "mrcp_message.h"
|
|
|
|
#include "mpf_activity_detector.h"
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
#include "pocketsphinx_properties.h"
|
2009-06-20 03:40:46 +00:00
|
|
|
#include "apt_log.h"
|
|
|
|
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
#define POCKETSPHINX_CONFFILE_NAME "pocketsphinx.xml"
|
2009-06-20 03:40:46 +00:00
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
#define RECOGNIZER_SIDRES(recognizer) (recognizer)->channel->id.buf, "pocketsphinx"
|
|
|
|
|
2009-06-20 03:40:46 +00:00
|
|
|
typedef struct pocketsphinx_engine_t pocketsphinx_engine_t;
|
|
|
|
typedef struct pocketsphinx_recognizer_t pocketsphinx_recognizer_t;
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Methods of recognition engine */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_engine_destroy(mrcp_resource_engine_t *engine);
|
|
|
|
static apt_bool_t pocketsphinx_engine_open(mrcp_resource_engine_t *engine);
|
|
|
|
static apt_bool_t pocketsphinx_engine_close(mrcp_resource_engine_t *engine);
|
2009-06-26 20:18:39 +00:00
|
|
|
static mrcp_engine_channel_t* pocketsphinx_engine_recognizer_create(mrcp_resource_engine_t *engine, apr_pool_t *pool);
|
2009-06-20 03:40:46 +00:00
|
|
|
|
|
|
|
static const struct mrcp_engine_method_vtable_t engine_vtable = {
|
|
|
|
pocketsphinx_engine_destroy,
|
|
|
|
pocketsphinx_engine_open,
|
|
|
|
pocketsphinx_engine_close,
|
2009-06-26 20:18:39 +00:00
|
|
|
pocketsphinx_engine_recognizer_create
|
2009-06-20 03:40:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Methods of recognition channel (recognizer) */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_recognizer_destroy(mrcp_engine_channel_t *channel);
|
|
|
|
static apt_bool_t pocketsphinx_recognizer_open(mrcp_engine_channel_t *channel);
|
|
|
|
static apt_bool_t pocketsphinx_recognizer_close(mrcp_engine_channel_t *channel);
|
|
|
|
static apt_bool_t pocketsphinx_recognizer_request_process(mrcp_engine_channel_t *channel, mrcp_message_t *request);
|
|
|
|
|
|
|
|
static const struct mrcp_engine_channel_method_vtable_t channel_vtable = {
|
|
|
|
pocketsphinx_recognizer_destroy,
|
|
|
|
pocketsphinx_recognizer_open,
|
|
|
|
pocketsphinx_recognizer_close,
|
|
|
|
pocketsphinx_recognizer_request_process
|
|
|
|
};
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Methods of audio stream to recognize */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_stream_write(mpf_audio_stream_t *stream, const mpf_frame_t *frame);
|
|
|
|
|
|
|
|
static const mpf_audio_stream_vtable_t audio_stream_vtable = {
|
2009-06-26 20:18:39 +00:00
|
|
|
NULL, /* destroy */
|
|
|
|
NULL, /* open_rx */
|
|
|
|
NULL, /* close_rx */
|
|
|
|
NULL, /* read_frame */
|
|
|
|
NULL, /* open_tx */
|
|
|
|
NULL, /* close_tx */
|
2009-06-20 03:40:46 +00:00
|
|
|
pocketsphinx_stream_write
|
|
|
|
};
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Pocketsphinx engine (engine is an aggregation of recognizers) */
|
2009-06-20 03:40:46 +00:00
|
|
|
struct pocketsphinx_engine_t {
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
/* Resource engine base */
|
|
|
|
mrcp_resource_engine_t *base;
|
|
|
|
/** Properties loaded from config file */
|
|
|
|
pocketsphinx_properties_t properties;
|
2009-06-26 20:18:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Pocketsphinx channel (recognizer) */
|
2009-06-20 03:40:46 +00:00
|
|
|
struct pocketsphinx_recognizer_t {
|
|
|
|
/** Engine channel base */
|
2009-06-26 20:18:39 +00:00
|
|
|
mrcp_engine_channel_t *channel;
|
|
|
|
|
|
|
|
/** Actual recognizer object */
|
|
|
|
ps_decoder_t *decoder;
|
|
|
|
/** Configuration */
|
|
|
|
cmd_ln_t *config;
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
/** Recognizer properties coppied from defualt engine properties */
|
2009-06-26 20:18:39 +00:00
|
|
|
pocketsphinx_properties_t properties;
|
|
|
|
/** Is input timer started */
|
|
|
|
apt_bool_t is_input_timer_on;
|
|
|
|
/** Noinput timeout */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
apr_size_t no_input_timeout;
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Recognition timeout */
|
|
|
|
apr_size_t recognition_timeout;
|
|
|
|
/** Timeout elapsed since the last partial result checking */
|
|
|
|
apr_size_t partial_result_timeout;
|
|
|
|
/** Last (partially) recognized result */
|
|
|
|
const char *last_result;
|
|
|
|
/** Active grammar identifier (content-id) */
|
|
|
|
const char *grammar_id;
|
|
|
|
/** Table of defined grammars (key=content-id, value=grammar-file-path) */
|
|
|
|
apr_table_t *grammar_table;
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
/** File to write waveform to if save_waveform is on */
|
|
|
|
apr_file_t *waveform;
|
2009-06-26 20:18:39 +00:00
|
|
|
|
|
|
|
/** Voice activity detector */
|
|
|
|
mpf_activity_detector_t *detector;
|
|
|
|
|
|
|
|
/** Thread to run recognition in */
|
|
|
|
apr_thread_t *thread;
|
|
|
|
/** Conditional wait object */
|
|
|
|
apr_thread_cond_t *wait_object;
|
|
|
|
/** Mutex of the wait object */
|
|
|
|
apr_thread_mutex_t *mutex;
|
|
|
|
|
|
|
|
/** Pending request from client stack to recognizer */
|
|
|
|
mrcp_message_t *request;
|
|
|
|
/** Pending event from mpf layer to recognizer */
|
|
|
|
mrcp_message_t *complete_event;
|
|
|
|
/** In-progress RECOGNIZE request */
|
|
|
|
mrcp_message_t *inprogress_recog;
|
|
|
|
/** Pending STOP response */
|
|
|
|
mrcp_message_t *stop_response;
|
|
|
|
/** Is recognition channel being closed */
|
|
|
|
apt_bool_t close_requested;
|
2009-06-20 03:40:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Declare this macro to use log routine of the server, plugin is loaded from */
|
|
|
|
MRCP_PLUGIN_LOGGER_IMPLEMENT
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
static void* APR_THREAD_FUNC pocketsphinx_recognizer_run(apr_thread_t *thread, void *data);
|
2009-06-20 03:40:46 +00:00
|
|
|
|
|
|
|
/** Create pocketsphinx engine (engine is an aggregation of recognizers) */
|
|
|
|
MRCP_PLUGIN_DECLARE(mrcp_resource_engine_t*) mrcp_plugin_create(apr_pool_t *pool)
|
|
|
|
{
|
|
|
|
pocketsphinx_engine_t *engine = apr_palloc(pool,sizeof(pocketsphinx_engine_t));
|
2009-06-26 20:18:39 +00:00
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Create PocketSphinx Engine");
|
2009-06-20 03:40:46 +00:00
|
|
|
|
|
|
|
/* create resource engine base */
|
|
|
|
engine->base = mrcp_resource_engine_create(
|
|
|
|
MRCP_RECOGNIZER_RESOURCE, /* MRCP resource identifier */
|
|
|
|
engine, /* object to associate */
|
|
|
|
&engine_vtable, /* virtual methods table of resource engine */
|
|
|
|
pool); /* pool to allocate memory from */
|
|
|
|
return engine->base;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Destroy pocketsphinx engine */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
static apt_bool_t pocketsphinx_engine_destroy(mrcp_resource_engine_t *resource_engine)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Open pocketsphinx engine */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
static apt_bool_t pocketsphinx_engine_open(mrcp_resource_engine_t *resource_engine)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
pocketsphinx_engine_t *engine = resource_engine->obj;
|
|
|
|
const apt_dir_layout_t *dir_layout = resource_engine->dir_layout;
|
|
|
|
|
|
|
|
char *file_path = NULL;
|
|
|
|
apr_filepath_merge(&file_path,dir_layout->conf_dir_path,POCKETSPHINX_CONFFILE_NAME,0,resource_engine->pool);
|
|
|
|
|
|
|
|
/* load properties */
|
|
|
|
pocketsphinx_properties_load(&engine->properties,file_path,dir_layout,resource_engine->pool);
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Close pocketsphinx engine */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
static apt_bool_t pocketsphinx_engine_close(mrcp_resource_engine_t *resource_engine)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Create pocketsphinx recognizer */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
static mrcp_engine_channel_t* pocketsphinx_engine_recognizer_create(mrcp_resource_engine_t *resource_engine, apr_pool_t *pool)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
|
|
|
mrcp_engine_channel_t *channel;
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
mpf_codec_descriptor_t *codec_descriptor;
|
|
|
|
pocketsphinx_engine_t *engine = resource_engine->obj;
|
2009-06-20 03:40:46 +00:00
|
|
|
pocketsphinx_recognizer_t *recognizer = apr_palloc(pool,sizeof(pocketsphinx_recognizer_t));
|
2009-06-26 20:18:39 +00:00
|
|
|
recognizer->decoder = NULL;
|
|
|
|
recognizer->config = NULL;
|
|
|
|
recognizer->is_input_timer_on = FALSE;
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
recognizer->no_input_timeout = 0;
|
2009-06-26 20:18:39 +00:00
|
|
|
recognizer->recognition_timeout = 0;
|
|
|
|
recognizer->partial_result_timeout = 0;
|
|
|
|
recognizer->last_result = NULL;
|
|
|
|
recognizer->detector = NULL;
|
|
|
|
recognizer->thread = NULL;
|
|
|
|
recognizer->wait_object = NULL;
|
|
|
|
recognizer->mutex = NULL;
|
|
|
|
recognizer->request = NULL;
|
|
|
|
recognizer->complete_event = NULL;
|
|
|
|
recognizer->inprogress_recog = FALSE;
|
|
|
|
recognizer->stop_response = NULL;
|
|
|
|
recognizer->close_requested = FALSE;
|
|
|
|
recognizer->grammar_id = NULL;
|
|
|
|
recognizer->grammar_table = apr_table_make(pool,1);
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
recognizer->waveform = NULL;
|
|
|
|
|
|
|
|
/* copy default properties loaded from config */
|
|
|
|
recognizer->properties = engine->properties;
|
|
|
|
|
|
|
|
codec_descriptor = (mpf_codec_descriptor_t *) apr_palloc(pool,sizeof(mpf_codec_descriptor_t));
|
|
|
|
mpf_codec_descriptor_init(codec_descriptor);
|
|
|
|
codec_descriptor->channel_count = 1;
|
|
|
|
codec_descriptor->payload_type = 96;
|
|
|
|
apt_string_set(&codec_descriptor->name,"LPCM");
|
|
|
|
codec_descriptor->sampling_rate = 8000;
|
|
|
|
if(recognizer->properties.preferred_model == POCKETSPHINX_MODEL_WIDEBAND) {
|
|
|
|
codec_descriptor->sampling_rate = 16000;
|
|
|
|
}
|
|
|
|
|
2009-06-20 03:40:46 +00:00
|
|
|
/* create engine channel base */
|
|
|
|
channel = mrcp_engine_sink_channel_create(
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
resource_engine, /* resource engine */
|
2009-06-20 03:40:46 +00:00
|
|
|
&channel_vtable, /* virtual methods table of engine channel */
|
|
|
|
&audio_stream_vtable, /* virtual methods table of audio stream */
|
|
|
|
recognizer, /* object to associate */
|
|
|
|
NULL, /* codec descriptor might be NULL by default */
|
|
|
|
pool); /* pool to allocate memory from */
|
2009-07-15 20:30:39 +00:00
|
|
|
|
|
|
|
apr_thread_mutex_create(&recognizer->mutex,APR_THREAD_MUTEX_DEFAULT,channel->pool);
|
|
|
|
apr_thread_cond_create(&recognizer->wait_object,channel->pool);
|
|
|
|
|
2009-06-20 03:40:46 +00:00
|
|
|
recognizer->channel = channel;
|
|
|
|
return channel;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Destroy pocketsphinx recognizer */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_recognizer_destroy(mrcp_engine_channel_t *channel)
|
|
|
|
{
|
2009-07-15 20:30:39 +00:00
|
|
|
pocketsphinx_recognizer_t *recognizer = channel->method_obj;
|
|
|
|
if(recognizer->mutex) {
|
|
|
|
apr_thread_mutex_destroy(recognizer->mutex);
|
|
|
|
recognizer->mutex = NULL;
|
|
|
|
}
|
|
|
|
if(recognizer->wait_object) {
|
|
|
|
apr_thread_cond_destroy(recognizer->wait_object);
|
|
|
|
recognizer->wait_object = NULL;
|
|
|
|
}
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Open pocketsphinx recognizer (asynchronous response MUST be sent) */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_recognizer_open(mrcp_engine_channel_t *channel)
|
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
apr_status_t rv;
|
|
|
|
pocketsphinx_recognizer_t *recognizer = channel->method_obj;
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Open Channel "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
|
|
|
|
/* Launch a thread to run recognition in */
|
|
|
|
rv = apr_thread_create(&recognizer->thread,NULL,pocketsphinx_recognizer_run,recognizer,channel->pool);
|
|
|
|
if(rv != APR_SUCCESS) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Failed to Launch Thread "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
return mrcp_engine_channel_open_respond(channel,FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2009-06-20 03:40:46 +00:00
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Close pocketsphinx recognizer (asynchronous response MUST be sent)*/
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_recognizer_close(mrcp_engine_channel_t *channel)
|
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
pocketsphinx_recognizer_t *recognizer = channel->method_obj;
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Close Channel "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
2009-07-15 20:30:39 +00:00
|
|
|
if(!recognizer->thread) {
|
|
|
|
return mrcp_engine_channel_close_respond(channel);
|
2009-06-26 20:18:39 +00:00
|
|
|
}
|
|
|
|
|
2009-07-15 20:30:39 +00:00
|
|
|
/* Signal recognition thread to terminate */
|
|
|
|
apr_thread_mutex_lock(recognizer->mutex);
|
|
|
|
recognizer->close_requested = TRUE;
|
|
|
|
apr_thread_cond_signal(recognizer->wait_object);
|
|
|
|
apr_thread_mutex_unlock(recognizer->mutex);
|
|
|
|
return TRUE;
|
2009-06-20 03:40:46 +00:00
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Process MRCP request (asynchronous response MUST be sent)*/
|
|
|
|
static apt_bool_t pocketsphinx_recognizer_request_process(mrcp_engine_channel_t *channel, mrcp_message_t *request)
|
|
|
|
{
|
|
|
|
pocketsphinx_recognizer_t *recognizer = channel->method_obj;
|
|
|
|
|
|
|
|
/* Store request and signal recognition thread to process the request */
|
|
|
|
apr_thread_mutex_lock(recognizer->mutex);
|
|
|
|
recognizer->request = request;
|
|
|
|
apr_thread_cond_signal(recognizer->wait_object);
|
|
|
|
apr_thread_mutex_unlock(recognizer->mutex);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Initialize pocketsphinx decoder [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_decoder_init(pocketsphinx_recognizer_t *recognizer, const char *grammar)
|
|
|
|
{
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
const char *model = recognizer->properties.model_8k;
|
|
|
|
const char *rate = "8000";
|
|
|
|
if(recognizer->properties.preferred_model == POCKETSPHINX_MODEL_WIDEBAND) {
|
|
|
|
model = recognizer->properties.model_16k;
|
|
|
|
rate = "16000";
|
|
|
|
}
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Init Config rate [%s] dictionary [%s] "APT_SIDRES_FMT,
|
|
|
|
rate,
|
|
|
|
recognizer->properties.dictionary,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
2009-06-26 20:18:39 +00:00
|
|
|
recognizer->config = cmd_ln_init(recognizer->config, ps_args(), FALSE,
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
"-samprate", rate,
|
|
|
|
"-hmm", model,
|
2009-06-26 20:18:39 +00:00
|
|
|
"-jsgf", grammar,
|
|
|
|
"-dict", recognizer->properties.dictionary,
|
|
|
|
"-frate", "50",
|
|
|
|
"-silprob", "0.005",
|
|
|
|
NULL);
|
|
|
|
if(!recognizer->config) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Init Config "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Init Decoder "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
if(recognizer->decoder) {
|
|
|
|
if(ps_reinit(recognizer->decoder,recognizer->config) < 0) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Reinit Decoder "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
recognizer->decoder = ps_init(recognizer->config);
|
|
|
|
if(!recognizer->decoder) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Init Decoder "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!recognizer->detector) {
|
|
|
|
recognizer->detector = mpf_activity_detector_create(recognizer->channel->pool);
|
|
|
|
mpf_activity_detector_level_set(recognizer->detector,50);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Build pocketsphinx recognized result [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_result_build(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *message)
|
|
|
|
{
|
|
|
|
apt_str_t *body = &message->body;
|
|
|
|
if(!recognizer->last_result || !recognizer->grammar_id) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
body->buf = apr_psprintf(message->pool,
|
|
|
|
"<?xml version=\"1.0\"?>\n"
|
|
|
|
"<result grammar=\"%s\">\n"
|
|
|
|
" <interpretation grammar=\"%s\" confidence=\"%d\">\n"
|
|
|
|
" <input mode=\"speech\">%s</input>\n"
|
|
|
|
" </interpretation>\n"
|
|
|
|
"</result>\n",
|
|
|
|
recognizer->grammar_id,
|
|
|
|
recognizer->grammar_id,
|
|
|
|
99,
|
|
|
|
recognizer->last_result,
|
|
|
|
recognizer->last_result);
|
|
|
|
if(body->buf) {
|
|
|
|
mrcp_generic_header_t *generic_header;
|
|
|
|
generic_header = mrcp_generic_header_prepare(message);
|
|
|
|
if(generic_header) {
|
|
|
|
/* set content type */
|
|
|
|
apt_string_assign(&generic_header->content_type,"application/x-nlsml",message->pool);
|
|
|
|
mrcp_generic_header_property_add(message,GENERIC_HEADER_CONTENT_TYPE);
|
|
|
|
}
|
|
|
|
|
|
|
|
body->length = strlen(body->buf);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Clear pocketsphinx grammars [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_grammars_clear(pocketsphinx_recognizer_t *recognizer)
|
|
|
|
{
|
|
|
|
const apr_array_header_t *tarr = apr_table_elts(recognizer->grammar_table);
|
|
|
|
const apr_table_entry_t *telts = (const apr_table_entry_t*)tarr->elts;
|
|
|
|
int i;
|
|
|
|
for(i = 0; i < tarr->nelts; i++) {
|
|
|
|
const char *grammar_file_path = telts[i].val;
|
|
|
|
if(grammar_file_path) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remove Grammar File [%s] "APT_SIDRES_FMT,
|
|
|
|
grammar_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
apr_file_remove(grammar_file_path,recognizer->channel->pool);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
apr_table_clear(recognizer->grammar_table);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Process DEFINE-GRAMMAR request [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_define_grammar(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request, mrcp_message_t *response)
|
|
|
|
{
|
|
|
|
const char *content_type = NULL;
|
|
|
|
const char *content_id = NULL;
|
|
|
|
apt_str_t *grammar = NULL;
|
|
|
|
|
|
|
|
mrcp_engine_channel_t *channel = recognizer->channel;
|
|
|
|
|
|
|
|
/* get recognizer header */
|
|
|
|
mrcp_generic_header_t *generic_header = mrcp_generic_header_get(request);
|
|
|
|
mrcp_recog_header_t *recog_header = mrcp_resource_header_prepare(response);
|
|
|
|
if(!generic_header || !recog_header) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_SUCCESS;
|
|
|
|
mrcp_resource_header_property_add(response,RECOGNIZER_HEADER_COMPLETION_CAUSE);
|
|
|
|
|
|
|
|
/* content-id must be specified */
|
|
|
|
if(mrcp_generic_header_property_check(request,GENERIC_HEADER_CONTENT_ID) == TRUE) {
|
|
|
|
content_id = generic_header->content_id.buf;
|
|
|
|
}
|
|
|
|
if(!content_id) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing Content-Id "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_MISSING_PARAM;
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_GRAM_LOAD_FAILURE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mrcp_generic_header_property_check(request,GENERIC_HEADER_CONTENT_LENGTH) == TRUE) {
|
|
|
|
grammar = &request->body;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(grammar) {
|
|
|
|
/* load grammar */
|
|
|
|
const apt_dir_layout_t *dir_layout = channel->engine->dir_layout;
|
|
|
|
const char *grammar_file_path = NULL;
|
|
|
|
const char *grammar_file_name = NULL;
|
|
|
|
apr_file_t *fd = NULL;
|
|
|
|
apr_status_t rv;
|
|
|
|
apr_size_t size;
|
|
|
|
|
|
|
|
/* content-type must be specified */
|
|
|
|
if(mrcp_generic_header_property_check(request,GENERIC_HEADER_CONTENT_TYPE) == TRUE) {
|
|
|
|
content_type = generic_header->content_type.buf;
|
|
|
|
}
|
|
|
|
if(!content_type) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing Content-Type "APT_SIDRES_FMT,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_MISSING_PARAM;
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_GRAM_LOAD_FAILURE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only JSGF grammar is supported */
|
|
|
|
if(strstr(content_type,"jsgf") == NULL) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Not Supported Content-Type [%s] "APT_SIDRES_FMT,
|
|
|
|
content_type,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_UNSUPPORTED_PARAM_VALUE;
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_GRAM_LOAD_FAILURE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
grammar_file_name = apr_psprintf(channel->pool,"%s-%s.gram",channel->id.buf,content_id);
|
2009-06-26 20:18:39 +00:00
|
|
|
grammar_file_path = apt_datadir_filepath_get(dir_layout,grammar_file_name,channel->pool);
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Create Grammar File [%s] "APT_SIDRES_FMT,
|
|
|
|
grammar_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
rv = apr_file_open(&fd,grammar_file_path,APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY,
|
|
|
|
APR_OS_DEFAULT,channel->pool);
|
|
|
|
if(rv != APR_SUCCESS) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Cannot Open Grammar File to Write [%s] "APT_SIDRES_FMT,
|
|
|
|
grammar_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_METHOD_FAILED;
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_GRAM_LOAD_FAILURE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
size = grammar->length;
|
|
|
|
apr_file_write(fd,grammar->buf,&size);
|
|
|
|
apr_file_close(fd);
|
|
|
|
|
|
|
|
/* init pocketsphinx decoder */
|
|
|
|
if(pocketsphinx_decoder_init(recognizer,grammar_file_path) == TRUE) {
|
|
|
|
recognizer->grammar_id = content_id;
|
|
|
|
apr_table_setn(recognizer->grammar_table,content_id,grammar_file_path);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_METHOD_FAILED;
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_GRAM_LOAD_FAILURE;
|
|
|
|
apr_file_remove(grammar_file_path,channel->pool);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* unload grammar */
|
|
|
|
const char *grammar_file_path = apr_table_get(recognizer->grammar_table,content_id);
|
|
|
|
if(grammar_file_path) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remove Grammar File [%s] "APT_SIDRES_FMT,
|
|
|
|
grammar_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
apr_file_remove(grammar_file_path,channel->pool);
|
|
|
|
apr_table_unset(recognizer->grammar_table,content_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send asynchronous response */
|
|
|
|
mrcp_engine_channel_message_send(channel,response);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-06-20 03:40:46 +00:00
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Process RECOGNIZE request [RECOG] */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_recognize(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request, mrcp_message_t *response)
|
|
|
|
{
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
mrcp_engine_channel_t *channel = recognizer->channel;
|
2009-06-26 20:18:39 +00:00
|
|
|
mrcp_recog_header_t *request_recog_header;
|
|
|
|
mrcp_recog_header_t *response_recog_header = mrcp_resource_header_prepare(response);
|
|
|
|
if(!response_recog_header) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!recognizer->decoder || ps_start_utt(recognizer->decoder, NULL) < 0) {
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_METHOD_FAILED;
|
|
|
|
response_recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_ERROR;
|
2009-07-15 20:30:39 +00:00
|
|
|
mrcp_resource_header_property_add(response,RECOGNIZER_HEADER_COMPLETION_CAUSE);
|
2009-06-26 20:18:39 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
recognizer->is_input_timer_on = TRUE;
|
|
|
|
/* get recognizer header */
|
|
|
|
request_recog_header = mrcp_resource_header_get(request);
|
|
|
|
if(request_recog_header) {
|
|
|
|
if(mrcp_resource_header_property_check(request,RECOGNIZER_HEADER_START_INPUT_TIMERS) == TRUE) {
|
|
|
|
recognizer->is_input_timer_on = request_recog_header->start_input_timers;
|
|
|
|
}
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
if(mrcp_resource_header_property_check(request,RECOGNIZER_HEADER_NO_INPUT_TIMEOUT) == TRUE) {
|
|
|
|
recognizer->properties.no_input_timeout = request_recog_header->no_input_timeout;
|
|
|
|
}
|
|
|
|
if(mrcp_resource_header_property_check(request,RECOGNIZER_HEADER_RECOGNITION_TIMEOUT) == TRUE) {
|
|
|
|
recognizer->properties.recognition_timeout = request_recog_header->recognition_timeout;
|
|
|
|
}
|
|
|
|
if(mrcp_resource_header_property_check(request,RECOGNIZER_HEADER_SAVE_WAVEFORM) == TRUE) {
|
|
|
|
recognizer->properties.save_waveform = request_recog_header->save_waveform;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check if waveform (utterance) should be saved */
|
|
|
|
if(recognizer->properties.save_waveform == TRUE) {
|
|
|
|
apr_status_t rv;
|
|
|
|
const char *waveform_file_name = apr_psprintf(channel->pool,"utter-%s-%d.pcm",
|
|
|
|
channel->id.buf,request->start_line.request_id);
|
|
|
|
char *waveform_file_path = NULL;
|
|
|
|
apr_filepath_merge(&waveform_file_path,recognizer->properties.save_waveform_dir,
|
|
|
|
waveform_file_name,0,channel->pool);
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Open Waveform File [%s] "APT_SIDRES_FMT,
|
|
|
|
waveform_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
rv = apr_file_open(&recognizer->waveform,waveform_file_path,APR_CREATE|APR_TRUNCATE|APR_WRITE|APR_BINARY,
|
|
|
|
APR_OS_DEFAULT,channel->pool);
|
|
|
|
if(rv != APR_SUCCESS) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Cannot Open Waveform File to Write [%s] "APT_SIDRES_FMT,
|
|
|
|
waveform_file_path,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
}
|
2009-06-26 20:18:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
response->start_line.request_state = MRCP_REQUEST_STATE_INPROGRESS;
|
|
|
|
/* send asynchronous response */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
mrcp_engine_channel_message_send(channel,response);
|
2009-06-26 20:18:39 +00:00
|
|
|
|
|
|
|
/* reset */
|
|
|
|
mpf_activity_detector_reset(recognizer->detector);
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
recognizer->no_input_timeout = 0;
|
2009-06-26 20:18:39 +00:00
|
|
|
recognizer->recognition_timeout = 0;
|
|
|
|
recognizer->partial_result_timeout = 0;
|
|
|
|
recognizer->last_result = NULL;
|
|
|
|
recognizer->complete_event = NULL;
|
|
|
|
|
|
|
|
recognizer->inprogress_recog = request;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
/** Process GET-RESULT request [RECOG] */
|
2009-06-26 20:18:39 +00:00
|
|
|
static apt_bool_t pocketsphinx_get_result(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request, mrcp_message_t *response)
|
|
|
|
{
|
|
|
|
if(pocketsphinx_result_build(recognizer,response) != TRUE) {
|
|
|
|
response->start_line.status_code = MRCP_STATUS_CODE_METHOD_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send asynchronous response */
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,response);
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Process START-INPUT-TIMERS request [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_start_input_timers(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request, mrcp_message_t *response)
|
|
|
|
{
|
|
|
|
recognizer->is_input_timer_on = TRUE;
|
|
|
|
|
|
|
|
/* send asynchronous response */
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,response);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Process STOP request [RECOG] */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_stop(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request, mrcp_message_t *response)
|
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
if(recognizer->inprogress_recog) {
|
|
|
|
/* store pending STOP response for further processing */
|
|
|
|
recognizer->stop_response = response;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send asynchronous response */
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,response);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Process RECOGNITION-COMPLETE event [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_recognition_complete(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *complete_event)
|
|
|
|
{
|
|
|
|
mrcp_recog_header_t *recog_header;
|
|
|
|
if(!recognizer->inprogress_recog) {
|
|
|
|
/* false event */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
recognizer->inprogress_recog = NULL;
|
|
|
|
ps_end_utt(recognizer->decoder);
|
|
|
|
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
if(recognizer->waveform) {
|
|
|
|
apr_file_close(recognizer->waveform);
|
|
|
|
recognizer->waveform = NULL;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
if(recognizer->stop_response) {
|
|
|
|
/* recognition has been stopped, send STOP response instead */
|
|
|
|
mrcp_message_t *response = recognizer->stop_response;
|
|
|
|
recognizer->stop_response = NULL;
|
|
|
|
if(recognizer->close_requested == FALSE) {
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,response);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
recog_header = mrcp_resource_header_get(complete_event);
|
|
|
|
if(recog_header->completion_cause == RECOGNIZER_COMPLETION_CAUSE_SUCCESS ||
|
|
|
|
recog_header->completion_cause == RECOGNIZER_COMPLETION_CAUSE_RECOGNITION_TIMEOUT) {
|
|
|
|
int32 score;
|
|
|
|
char const *hyp;
|
|
|
|
char const *uttid;
|
|
|
|
|
|
|
|
hyp = ps_get_hyp(recognizer->decoder, &score, &uttid);
|
|
|
|
if(hyp && strlen(hyp) > 0) {
|
|
|
|
int32 prob;
|
|
|
|
recognizer->last_result = apr_pstrdup(recognizer->channel->pool,hyp);
|
|
|
|
prob = ps_get_prob(recognizer->decoder, &uttid);
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Get Recognition Final Result [%s] Prob [%d] Score [%d] "APT_SIDRES_FMT,
|
|
|
|
hyp,prob,score,RECOGNIZER_SIDRES(recognizer));
|
|
|
|
if(pocketsphinx_result_build(recognizer,complete_event) != TRUE) {
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
recog_header->completion_cause = RECOGNIZER_COMPLETION_CAUSE_NO_MATCH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send asynchronous event */
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,complete_event);
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Dispatch MRCP request [RECOG] */
|
|
|
|
static apt_bool_t pocketsphinx_request_dispatch(pocketsphinx_recognizer_t *recognizer, mrcp_message_t *request)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
|
|
|
apt_bool_t processed = FALSE;
|
|
|
|
mrcp_message_t *response = mrcp_response_create(request,request->pool);
|
2009-06-26 20:18:39 +00:00
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Dispatch Request %s "APT_SIDRES_FMT,
|
|
|
|
request->start_line.method_name.buf,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
2009-06-20 03:40:46 +00:00
|
|
|
switch(request->start_line.method_id) {
|
|
|
|
case RECOGNIZER_SET_PARAMS:
|
|
|
|
break;
|
|
|
|
case RECOGNIZER_GET_PARAMS:
|
|
|
|
break;
|
|
|
|
case RECOGNIZER_DEFINE_GRAMMAR:
|
2009-06-26 20:18:39 +00:00
|
|
|
processed = pocketsphinx_define_grammar(recognizer,request,response);
|
2009-06-20 03:40:46 +00:00
|
|
|
break;
|
|
|
|
case RECOGNIZER_RECOGNIZE:
|
|
|
|
processed = pocketsphinx_recognize(recognizer,request,response);
|
|
|
|
break;
|
|
|
|
case RECOGNIZER_GET_RESULT:
|
2009-06-26 20:18:39 +00:00
|
|
|
processed = pocketsphinx_get_result(recognizer,request,response);
|
2009-06-20 03:40:46 +00:00
|
|
|
break;
|
|
|
|
case RECOGNIZER_START_INPUT_TIMERS:
|
2009-06-26 20:18:39 +00:00
|
|
|
processed = pocketsphinx_start_input_timers(recognizer,request,response);
|
2009-06-20 03:40:46 +00:00
|
|
|
break;
|
|
|
|
case RECOGNIZER_STOP:
|
|
|
|
processed = pocketsphinx_stop(recognizer,request,response);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(processed == FALSE) {
|
2009-06-26 20:18:39 +00:00
|
|
|
/* send asynchronous response for non handled request */
|
|
|
|
mrcp_engine_channel_message_send(recognizer->channel,response);
|
2009-06-20 03:40:46 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Recognition thread [RECOG] */
|
|
|
|
static void* APR_THREAD_FUNC pocketsphinx_recognizer_run(apr_thread_t *thread, void *data)
|
|
|
|
{
|
|
|
|
pocketsphinx_recognizer_t *recognizer = data;
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Run Recognition Thread "APT_SIDRES_FMT, RECOGNIZER_SIDRES(recognizer));
|
|
|
|
/** Send response to channel_open request */
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
mrcp_engine_channel_open_respond(recognizer->channel,TRUE);
|
2009-06-26 20:18:39 +00:00
|
|
|
|
|
|
|
do {
|
|
|
|
/** Wait for MRCP requests */
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Wait for incoming messages "APT_SIDRES_FMT, RECOGNIZER_SIDRES(recognizer));
|
|
|
|
apr_thread_mutex_lock(recognizer->mutex);
|
|
|
|
apr_thread_cond_wait(recognizer->wait_object,recognizer->mutex);
|
|
|
|
apr_thread_mutex_unlock(recognizer->mutex);
|
|
|
|
|
|
|
|
if(recognizer->request) {
|
|
|
|
/* store request message and further dispatch it */
|
|
|
|
mrcp_message_t *request = recognizer->request;
|
|
|
|
recognizer->request = NULL;
|
|
|
|
pocketsphinx_request_dispatch(recognizer,request);
|
|
|
|
}
|
|
|
|
if(recognizer->complete_event) {
|
|
|
|
/* end of input detected, get recognition result and raise recognition complete event */
|
|
|
|
pocketsphinx_recognition_complete(recognizer,recognizer->complete_event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while(recognizer->close_requested == FALSE);
|
|
|
|
|
|
|
|
/** Clear all the defined grammars */
|
|
|
|
pocketsphinx_grammars_clear(recognizer);
|
|
|
|
|
|
|
|
if(recognizer->decoder) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Free Decoder "APT_SIDRES_FMT, RECOGNIZER_SIDRES(recognizer));
|
|
|
|
/** Free pocketsphinx decoder */
|
|
|
|
ps_free(recognizer->decoder);
|
|
|
|
recognizer->decoder = NULL;
|
|
|
|
}
|
2009-06-20 03:40:46 +00:00
|
|
|
|
2009-07-15 20:30:39 +00:00
|
|
|
recognizer->thread = NULL;
|
|
|
|
/** Finally send response to channel_close request */
|
|
|
|
mrcp_engine_channel_close_respond(recognizer->channel);
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/** Exit thread */
|
|
|
|
apr_thread_exit(thread,APR_SUCCESS);
|
|
|
|
return NULL;
|
2009-06-20 03:40:46 +00:00
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Start of input (utterance) [MPF] */
|
|
|
|
static apt_bool_t pocketsphinx_start_of_input(pocketsphinx_recognizer_t *recognizer)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
/* create START-OF-INPUT event */
|
|
|
|
mrcp_message_t *message = mrcp_event_create(
|
|
|
|
recognizer->inprogress_recog,
|
|
|
|
RECOGNIZER_START_OF_INPUT,
|
|
|
|
recognizer->inprogress_recog->pool);
|
|
|
|
if(!message) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set request state */
|
|
|
|
message->start_line.request_state = MRCP_REQUEST_STATE_INPROGRESS;
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
/* send asynchronous event */
|
2009-06-26 20:18:39 +00:00
|
|
|
return mrcp_engine_channel_message_send(recognizer->channel,message);
|
2009-06-20 03:40:46 +00:00
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/* End of input (utterance) [MPF] */
|
|
|
|
static apt_bool_t pocketsphinx_end_of_input(pocketsphinx_recognizer_t *recognizer, mrcp_recog_completion_cause_e cause)
|
2009-06-20 03:40:46 +00:00
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
mrcp_recog_header_t *recog_header;
|
|
|
|
/* create RECOGNITION-COMPLETE event */
|
|
|
|
mrcp_message_t *message = mrcp_event_create(
|
|
|
|
recognizer->inprogress_recog,
|
|
|
|
RECOGNIZER_RECOGNITION_COMPLETE,
|
|
|
|
recognizer->inprogress_recog->pool);
|
|
|
|
if(!message) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get/allocate recognizer header */
|
|
|
|
recog_header = mrcp_resource_header_prepare(message);
|
|
|
|
if(recog_header) {
|
|
|
|
/* set completion cause */
|
|
|
|
recog_header->completion_cause = cause;
|
|
|
|
mrcp_resource_header_property_add(message,RECOGNIZER_HEADER_COMPLETION_CAUSE);
|
|
|
|
}
|
|
|
|
/* set request state */
|
|
|
|
message->start_line.request_state = MRCP_REQUEST_STATE_COMPLETE;
|
|
|
|
|
|
|
|
/* signal recognition thread first */
|
|
|
|
apr_thread_mutex_lock(recognizer->mutex);
|
|
|
|
recognizer->complete_event = message;
|
|
|
|
apr_thread_cond_signal(recognizer->wait_object);
|
|
|
|
apr_thread_mutex_unlock(recognizer->mutex);
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
/* Process audio frame [MPF] */
|
2009-06-20 03:40:46 +00:00
|
|
|
static apt_bool_t pocketsphinx_stream_write(mpf_audio_stream_t *stream, const mpf_frame_t *frame)
|
|
|
|
{
|
2009-06-26 20:18:39 +00:00
|
|
|
pocketsphinx_recognizer_t *recognizer = stream->obj;
|
|
|
|
|
|
|
|
/* check whether recognition has been started and not completed yet */
|
|
|
|
if(recognizer->inprogress_recog && !recognizer->complete_event) {
|
|
|
|
mpf_detector_event_e det_event;
|
|
|
|
|
|
|
|
/* first check if STOP has been requested */
|
|
|
|
if(recognizer->stop_response) {
|
|
|
|
/* recognition has been stopped -> acknowledge with complete-event */
|
|
|
|
pocketsphinx_end_of_input(recognizer,RECOGNIZER_COMPLETION_CAUSE_SUCCESS);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
if(recognizer->waveform) {
|
|
|
|
/* write utterance to file */
|
|
|
|
apr_size_t size = frame->codec_frame.size;
|
|
|
|
apr_file_write(recognizer->waveform,frame->codec_frame.buffer,&size);
|
|
|
|
}
|
|
|
|
|
2009-06-26 20:18:39 +00:00
|
|
|
if(ps_process_raw(
|
|
|
|
recognizer->decoder,
|
|
|
|
(const int16 *)frame->codec_frame.buffer,
|
|
|
|
frame->codec_frame.size / sizeof(int16),
|
|
|
|
FALSE,
|
|
|
|
FALSE) < 0) {
|
|
|
|
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Process Raw Data "APT_SIDRES_FMT,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
|
|
|
}
|
|
|
|
|
|
|
|
recognizer->partial_result_timeout += CODEC_FRAME_TIME_BASE;
|
|
|
|
if(recognizer->partial_result_timeout == recognizer->properties.partial_result_timeout) {
|
|
|
|
int32 score;
|
|
|
|
char const *hyp;
|
|
|
|
char const *uttid;
|
|
|
|
|
|
|
|
recognizer->partial_result_timeout = 0;
|
|
|
|
hyp = ps_get_hyp(recognizer->decoder, &score, &uttid);
|
|
|
|
if(hyp && strlen(hyp) > 0) {
|
|
|
|
if(recognizer->last_result == NULL || 0 != strcmp(recognizer->last_result, hyp)) {
|
|
|
|
recognizer->last_result = apr_pstrdup(recognizer->channel->pool,hyp);
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Get Recognition Partial Result [%s] Score [%d] "APT_SIDRES_FMT,
|
|
|
|
hyp,score,RECOGNIZER_SIDRES(recognizer));
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
|
|
|
|
/* reset input timer as we have partial match now */
|
|
|
|
if(score != 0 && recognizer->is_input_timer_on) {
|
|
|
|
recognizer->is_input_timer_on = FALSE;
|
|
|
|
}
|
2009-06-26 20:18:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(recognizer->is_input_timer_on) {
|
commit e8f60761378fe392d80e89d0e3481316119e9809
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 14:44:09 2009 +0000
Further build and install integration
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1030 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 5b410e0dfc1852ee5c0d56d64b326d5130aed18a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:24:27 2009 +0000
Added utility project (preparesphinx) to copy the stuff pocketsphinx requires to run
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1029 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2457575de160b378affdfa7a37cac1282d0024ca
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 13:18:59 2009 +0000
Added a few more comments in config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1028 f001bc3a-424a-0410-80a0-a715b8f413a8
commit ffc40b15b409a79bdea286898ad1e8694fc1623c
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Tue Jun 30 10:38:54 2009 +0000
Added resampling to 8kHz so that it works with freeswitch (specify only L16/96/8000 codec in profile of media_engine/rtpfactory).
Changed logging to DEBUG level rather than INFO.
Added channel_guard for stop response.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1027 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit d11439611186b46f1bfabc036b7e5d76f33f8b0e
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 19:46:54 2009 +0000
Added entries for PocketSphinx (mrcppocketsphinx) and Flite (mrcpflite) plugins into unimrcpserver.xml (disabled by default)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1026 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 63bc73426ba4efdf648a28cd3c1ff1daaef5bb49
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 15:04:01 2009 +0000
Added enumeration of pocketsphinx models (narrowband, wideband), supported wideband either
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1025 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 04970484e4357e2a1c3c4385840640caada33468
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:21:35 2009 +0000
Removed engine->guard, as all relevant calls are made within the context of the same thread
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1024 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 9bac2f3abdcfea5397aca4b86e209af090631e7a
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Mon Jun 29 13:15:30 2009 +0000
Initialized 16kHz codec descriptor for flite channel, since available flite voice are in 16kHz.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1023 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4e902eb985b433416723f15646d3e99d385d18cb
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 20:05:22 2009 +0000
Do not create bridge if resampling is required.
Several sampling rates are supported, but there is no resampling yet.
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1022 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 6d35b1246a7061e4c8f3f608bb17e146870d63bd
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:14:25 2009 +0000
Added makefile target to install pocketsphinx.xml with make install
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1021 f001bc3a-424a-0410-80a0-a715b8f413a8
commit c2b75c89d57c02bd8d4360aebcb7406ecbf90eb0
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 18:10:01 2009 +0000
Set svn props (eol:native)
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1020 f001bc3a-424a-0410-80a0-a715b8f413a8
commit dd91ebea823dd2169e8c30f0cfe87fa199e1a0c2
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 17:46:46 2009 +0000
Loaded pocketsphinx's properties from config file
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1019 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 2ba91890593d7a64136e675bb937efd9a2542cc7
Author: garmt.noname@gmail.com <garmt.noname@gmail.com@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sun Jun 28 12:29:54 2009 +0000
Removed session tasks, most channel tasks, flite voices are no longer global
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1018 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 0d739127f9267b3ad871d1a53a863802f101a6b5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 09:15:20 2009 +0000
Implemented save_waveform, utterance will be saved in the filesystem
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1017 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 4ffd282ddf54ad861d73f36567ad201d135feff5
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 08:24:19 2009 +0000
Set 2 digits precision (digits after the decimal point) while generating float type values (Issue-35).
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1016 f001bc3a-424a-0410-80a0-a715b8f413a8
commit 90446f5e6ece40e91fd5b340a45e6773e4e80a0f
Author: achaloyan <achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8>
Date: Sat Jun 27 07:42:52 2009 +0000
Set noinut and recognition timeouts if specified in RECOGNIZE request, reset input timer on partial match
git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1015 f001bc3a-424a-0410-80a0-a715b8f413a8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14104 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-07-02 00:54:48 +00:00
|
|
|
recognizer->no_input_timeout += CODEC_FRAME_TIME_BASE;
|
|
|
|
if(recognizer->no_input_timeout == recognizer->properties.no_input_timeout) {
|
2009-06-26 20:18:39 +00:00
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Noinput Timeout Elapsed "APT_SIDRES_FMT,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
|
|
|
pocketsphinx_end_of_input(recognizer,RECOGNIZER_COMPLETION_CAUSE_NO_INPUT_TIMEOUT);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
recognizer->recognition_timeout += CODEC_FRAME_TIME_BASE;
|
|
|
|
if(recognizer->recognition_timeout == recognizer->properties.recognition_timeout) {
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Recognition Timeout Elapsed "APT_SIDRES_FMT,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
|
|
|
pocketsphinx_end_of_input(recognizer,RECOGNIZER_COMPLETION_CAUSE_RECOGNITION_TIMEOUT);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
det_event = mpf_activity_detector_process(recognizer->detector,frame);
|
|
|
|
switch(det_event) {
|
|
|
|
case MPF_DETECTOR_EVENT_ACTIVITY:
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Detected Voice Activity "APT_SIDRES_FMT,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
|
|
|
pocketsphinx_start_of_input(recognizer);
|
|
|
|
break;
|
|
|
|
case MPF_DETECTOR_EVENT_INACTIVITY:
|
|
|
|
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Detected Voice Inactivity "APT_SIDRES_FMT,
|
|
|
|
RECOGNIZER_SIDRES(recognizer));
|
|
|
|
pocketsphinx_end_of_input(recognizer,RECOGNIZER_COMPLETION_CAUSE_SUCCESS);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-20 03:40:46 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|