Go to the documentation of this file.
21 #include <pocketsphinx/pocketsphinx.h>
48 #define OFFSET(x) offsetof(ASRContext, x)
49 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
71 ps_process_raw(
s->ps, (
const int16_t *)in->
data[0], in->
nb_samples, 0, 0);
72 have_speech = ps_get_in_speech(
s->ps);
73 if (have_speech && !
s->utt_started)
75 if (!have_speech &&
s->utt_started) {
77 speech = ps_get_hyp(
s->ps,
NULL);
100 const float frate =
s->rate;
102 const char *argv[] = {
"-logfn",
s->logfn,
106 "-lmname",
s->lmname,
111 s->config = cmd_ln_parse_r(
NULL, ps_args(), 14, (
char **)argv, 0);
116 ps_default_search_args(
s->config);
117 s->ps = ps_init(
s->config);
149 cmd_ln_free_r(
s->config);
166 .priv_class = &asr_class,
static int query_formats(AVFilterContext *ctx)
A list of supported channel layouts.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
char * av_asprintf(const char *fmt,...)
This structure describes decoded (raw) audio or video data.
#define FILTER_QUERY_FUNC(func)
static const AVOption asr_options[]
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
A filter pad used for either input or output.
static int config_input(AVFilterLink *inlink)
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
static av_cold int asr_init(AVFilterContext *ctx)
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
int(* init)(AVBSFContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
static void uninit(AVBSFContext *ctx)
int nb_samples
number of audio samples (per channel) described by this frame
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold void asr_uninit(AVFilterContext *ctx)
const char * name
Pad name.
AVDictionary * metadata
metadata.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
AVFILTER_DEFINE_CLASS(asr)
#define AV_CHANNEL_LAYOUT_MONO
#define FILTER_OUTPUTS(array)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define flags(name, subs,...)
static const AVFilterPad asr_inputs[]