Go to the documentation of this file.
21 #include <pocketsphinx/pocketsphinx.h>
49 #define OFFSET(x) offsetof(ASRContext, x)
50 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
72 ps_process_raw(
s->ps, (
const int16_t *)in->
data[0], in->
nb_samples, 0, 0);
73 have_speech = ps_get_in_speech(
s->ps);
74 if (have_speech && !
s->utt_started)
76 if (!have_speech &&
s->utt_started) {
78 speech = ps_get_hyp(
s->ps,
NULL);
101 const float frate =
s->rate;
103 const char *argv[] = {
"-logfn",
s->logfn,
107 "-lmname",
s->lmname,
112 s->config = cmd_ln_parse_r(
NULL, ps_args(), 14, (
char **)argv, 0);
117 ps_default_search_args(
s->config);
118 s->ps = ps_init(
s->config);
135 { .nb_channels = 0 },
163 cmd_ln_free_r(
s->config);
180 .priv_class = &asr_class,
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.
enum MovChannelLayoutTag * layouts
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,...)
#define FILTER_INPUTS(array)
static const int sample_rates[]
This structure describes decoded (raw) audio or video data.
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_OUTPUTS(array)
Describe the class of an AVClass context structure.
static av_cold int asr_init(AVFilterContext *ctx)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
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.
static void uninit(AVBSFContext *ctx)
int nb_samples
number of audio samples (per channel) described by this frame
AVSampleFormat
Audio sample formats.
#define FILTER_QUERY_FUNC2(func)
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold void asr_uninit(AVFilterContext *ctx)
const char * name
Pad name.
@ AV_OPT_TYPE_INT
Underlying C type is int.
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
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[]
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...