Lines Matching defs:flite
23 * flite voice synth source
26 #include <flite/flite.h>
64 AVFILTER_DEFINE_CLASS(flite);
136 FliteContext *flite = ctx->priv;
139 if (flite->list_voices) {
146 av_log(ctx, AV_LOG_ERROR, "flite initialization failed\n");
152 if ((ret = select_voice(&flite->voice_entry, flite->voice_str, ctx)) < 0)
154 flite->voice = flite->voice_entry->voice;
156 if (flite->textfile && flite->text) {
162 if (flite->textfile) {
166 if ((ret = av_file_map(flite->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {
169 flite->textfile, av_err2str(ret));
173 if (!(flite->text = av_malloc(textbuf_size+1)))
175 memcpy(flite->text, textbuf, textbuf_size);
176 flite->text[textbuf_size] = 0;
180 if (!flite->text) {
187 flite->wave = flite_text_to_wave(flite->text, flite->voice);
188 flite->wave_samples = flite->wave->samples;
189 flite->wave_nb_samples = flite->wave->num_samples;
195 FliteContext *flite = ctx->priv;
197 if (!--flite->voice_entry->usage_count)
198 flite->voice_entry->unregister_fn(flite->voice);
199 flite->voice = NULL;
200 flite->voice_entry = NULL;
201 delete_wave(flite->wave);
202 flite->wave = NULL;
207 FliteContext *flite = ctx->priv;
210 int64_t chlayout = av_get_default_channel_layout(flite->wave->num_channels);
218 ff_add_format(&sample_rates, flite->wave->sample_rate);
227 FliteContext *flite = ctx->priv;
229 outlink->sample_rate = flite->wave->sample_rate;
230 outlink->time_base = (AVRational){1, flite->wave->sample_rate};
233 flite->voice_str,
241 FliteContext *flite = outlink->src->priv;
242 int nb_samples = FFMIN(flite->wave_nb_samples, flite->frame_nb_samples);
251 memcpy(samplesref->data[0], flite->wave_samples,
252 nb_samples * flite->wave->num_channels * 2);
253 samplesref->pts = flite->pts;
255 av_frame_set_sample_rate(samplesref, flite->wave->sample_rate);
256 flite->pts += nb_samples;
257 flite->wave_samples += nb_samples * flite->wave->num_channels;
258 flite->wave_nb_samples -= nb_samples;
274 .name = "flite",