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);
179 .p.priv_class = &asr_class,
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int config_input(AVFilterLink *inlink)
static const AVFilterPad asr_inputs[]
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static av_cold int asr_init(AVFilterContext *ctx)
static const AVOption asr_options[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static av_cold void asr_uninit(AVFilterContext *ctx)
static AVFormatContext * 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 ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
char * av_asprintf(const char *fmt,...)
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
Public libavutil channel layout APIs header.
static const int sample_rates[]
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ 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...
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
#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.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
enum MovChannelLayoutTag * layouts
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVDictionary * metadata
metadata.