FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
asrc_flite.c File Reference

flite voice synth source More...

#include <flite/flite.h>
#include "libavutil/channel_layout.h"
#include "libavutil/file.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  FliteContext
 
struct  voice_entry
 

Macros

#define OFFSET(x)   offsetof(FliteContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define DECLARE_REGISTER_VOICE_FN(name)
 
#define MAKE_VOICE_STRUCTURE(voice_name)
 

Functions

 AVFILTER_DEFINE_CLASS (flite)
 
 DECLARE_REGISTER_VOICE_FN (awb)
 
 DECLARE_REGISTER_VOICE_FN (kal)
 
 DECLARE_REGISTER_VOICE_FN (kal16)
 
 DECLARE_REGISTER_VOICE_FN (rms)
 
 DECLARE_REGISTER_VOICE_FN (slt)
 
static void list_voices (void *log_ctx, const char *sep)
 
static int select_voice (struct voice_entry **entry_ret, const char *voice_name, void *log_ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption flite_options []
 
static volatile int flite_inited = 0
 
struct voice_entry voice_entry
 
static struct voice_entry voice_entries []
 
static const AVFilterPad flite_outputs []
 
AVFilter ff_asrc_flite
 

Detailed Description

flite voice synth source

Definition in file asrc_flite.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(FliteContext, x)

Definition at line 50 of file asrc_flite.c.

Definition at line 51 of file asrc_flite.c.

#define DECLARE_REGISTER_VOICE_FN (   name)
Value:
cst_voice *register_cmu_us_## name(const char *); \
void unregister_cmu_us_## name(cst_voice *);
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
const char * name
Definition: opengl_enc.c:103

Definition at line 69 of file asrc_flite.c.

#define MAKE_VOICE_STRUCTURE (   voice_name)
Value:
{ \
.name = #voice_name, \
.register_fn = register_cmu_us_ ## voice_name, \
.unregister_fn = unregister_cmu_us_ ## voice_name, \
}

Definition at line 86 of file asrc_flite.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( flite  )
DECLARE_REGISTER_VOICE_FN ( awb  )
DECLARE_REGISTER_VOICE_FN ( kal  )
DECLARE_REGISTER_VOICE_FN ( kal16  )
DECLARE_REGISTER_VOICE_FN ( rms  )
DECLARE_REGISTER_VOICE_FN ( slt  )
static void list_voices ( void log_ctx,
const char *  sep 
)
static

Definition at line 99 of file asrc_flite.c.

Referenced by init(), and select_voice().

static int select_voice ( struct voice_entry **  entry_ret,
const char *  voice_name,
void log_ctx 
)
static

Definition at line 107 of file asrc_flite.c.

Referenced by init().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 134 of file asrc_flite.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 195 of file asrc_flite.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 207 of file asrc_flite.c.

static int config_props ( AVFilterLink outlink)
static

Definition at line 228 of file asrc_flite.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 242 of file asrc_flite.c.

Variable Documentation

const AVOption flite_options[]
static
Initial value:
= {
{ "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "nb_samples", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
{ "n", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
{ "text", "set text to speak", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "textfile", "set filename of the text to speak", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "v", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "voice", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: asrc_flite.c:51
static void list_voices(void *log_ctx, const char *sep)
Definition: asrc_flite.c:99
#define OFFSET(x)
Definition: asrc_flite.c:50

Definition at line 53 of file asrc_flite.c.

volatile int flite_inited = 0
static

Definition at line 66 of file asrc_flite.c.

Referenced by init().

struct voice_entry voice_entries[]
static
Initial value:
= {
}
#define MAKE_VOICE_STRUCTURE(voice_name)
Definition: asrc_flite.c:86

Definition at line 91 of file asrc_flite.c.

const AVFilterPad flite_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: asrc_flite.c:242
static int config_props(AVFilterLink *outlink)
Definition: asrc_flite.c:228

Definition at line 267 of file asrc_flite.c.

AVFilter ff_asrc_flite
Initial value:
= {
.name = "flite",
.description = NULL_IF_CONFIG_SMALL("Synthesize voice from text using libflite."),
.query_formats = query_formats,
.init = init,
.uninit = uninit,
.priv_size = sizeof(FliteContext),
.priv_class = &flite_class,
}
#define NULL
Definition: coverity.c:32
static av_cold void uninit(AVFilterContext *ctx)
Definition: asrc_flite.c:195
static int query_formats(AVFilterContext *ctx)
Definition: asrc_flite.c:207
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:389
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:379
static av_cold int init(AVFilterContext *ctx)
Definition: asrc_flite.c:134
static const AVFilterPad flite_outputs[]
Definition: asrc_flite.c:267

Definition at line 277 of file asrc_flite.c.