fernpass / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

audio streaming for ASR #152

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Arsen,

We are working on some of test-harness based on unimrcp. We want to perform 
audio streaming recognization based on the passed in audio bytes. It looks 
there are two APIs as follows,

How should I achieve this?

FYI, I try to write audio stream bytes via asr_session_stream_write then invoke 
asr_session_stream_recognize, but failed with failing to write the stream bytes 
into frame in API of asr_session_stream_write.

Thanks.

Qiuzhuang

/**
 * Initiate recognition based on specified grammar and input stream.
 * @param session the session to run recognition in the scope of
 * @param grammar_file the name of the grammar file to use (path is relative to data dir)
 * @param callback the callback to be called to get input media frames
 * @param obj the object to pass to the callback
 * @return the recognition result (input element of NLSML content)
 *
 * @remark Audio data should be streamed through 
 *         asr_session_stream_write() function calls.
 */
ASR_CLIENT_DECLARE(const char*) asr_session_stream_recognize(
                                    asr_session_t *session, 
                                    const char *grammar_file);

/**
 * Write audio data to recognize.
 * @param session the session to write audio data for
 * @param data the audio data
 * @param size the size of data
 */
ASR_CLIENT_DECLARE(apt_bool_t) asr_session_stream_write(
                                    asr_session_t *session,
                                    char *data,
                                    int size);

Original issue reported on code.google.com by Qiuzhuan...@gmail.com on 11 Mar 2013 at 8:04

GoogleCodeExporter commented 8 years ago
Hi Qiuzhuang,

First of all, I'd ask you to direct this sort of questions to the discussion 
group.

http://groups.google.com/forum/?fromgroups#!forum/unimrcp

Next, answering your question, I think the problem might be in the max number 
of frames the mpf_frame_buffer can accommodate at any given time. You may 
increase that number. See the function mpf_frame_buffer_create() 

http://code.google.com/p/unimrcp/source/browse/trunk/platforms/libasr-client/src
/asr_engine.c#524.

Also, I wanted to mention that libasrclient (the library you are currently 
using) is a high level library created on top of generic libunimrcpclient.

Hope this helps.

Original comment by achalo...@gmail.com on 18 Mar 2013 at 6:49

GoogleCodeExporter commented 8 years ago
If you have any further questions, please direct them to the discussion group. 
I'm closing this issue.

Original comment by achalo...@gmail.com on 26 Mar 2013 at 9:03