2

Having read about the the libflite library in man ffmpeg-filters I am already familiar enough with it to make ffplay speak in different voices, like so:

ffplay -f lavfi flite=text='Love':voice=kal
ffplay -f lavfi flite=text='Love':voice=slt

How do I list all the voices available in the libflite library? I've tried ffmpeg -f lavfi flite=list_voices=1 but I get Requested output format 'lavfi' is not a suitable output format flite=list_voices=1: Invalid argument

2 Answers 2

2

According to the Armadeus project - Flite, these are :

$flite -lv
Voices available: kal awb_time kal16 awb rms slt

You may also see this list in the source file asrc_flite.c line 91 :

static struct voice_entry voice_entries[] = {
    MAKE_VOICE_STRUCTURE(awb),
    MAKE_VOICE_STRUCTURE(kal),
    MAKE_VOICE_STRUCTURE(kal16),
    MAKE_VOICE_STRUCTURE(rms),
    MAKE_VOICE_STRUCTURE(slt),
};

For more information see FFMPEG-FILTERS(1).

1
  • 1
    Thanks, it works. In order to run flite -lv I had to install it first: sudo apt install flite. Before installing it I just had libflite1 installed and it was enough to use the library with ffplay and ffmpeg.
    – John Smith
    Nov 6, 2022 at 14:11
3

Here is how to properly ask the filter flite to list voices from FFMPEG:

ffmpeg -f lavfi -i "flite=list_voices=true"

Your attempt was just missing a -i in front of the filter, and replace 1 with true. Filters like flite, which don't take in Audio/Video as input, can be used as input themselves when using lavfi. Another example of this is the mandelbrot filter; while flite outputs audio, mandelbrot outputs video.

Available voice options for flite as of FFMPEG gitmaster dated 2023/06/08:

awb
kal
kal16
rms
slt
5
  • ffmpeg -f lavfi -i "flite=list_voices=true" raises "Error opening input file flite=list_voices=true."
    – Apostolos
    Aug 13, 2023 at 17:25
  • @Apostolos Are you running the latest git master version? If so it should work unless maybe your console handles quotes differently. you can alternatively try removing the quotes or also try ffmpeg -filter_complex flite=list_voices=true
    – programmar
    Aug 24, 2023 at 20:42
  • The error I mentioned was from ffmpeg 4.0. I upgraded to 6.0 and it shows the 5 voices. But since ffmpeg loves showing error messages --can't do without them, they are part of its insanity-- after showing the list, it ends with another error this time: "Error processing filtergraph" (when -f lavfi is used) and "Error initializing filters" (when -filter_complex is used). Thanks anyway.
    – Apostolos
    Aug 25, 2023 at 4:30
  • 1
    @Apostolos Yes, no need to worry about those error messages. They happen simply because there is currently no supported way to ask ffmpeg to invoke a filter without giving it a task, and so FFMPEG will return an error message since it finds no task to execute with the filter after said filter was invoked to display some messages. For now you can think of those commands as a workaround to querying a filter without having it do any actual filtering.
    – programmar
    Sep 9, 2023 at 22:33
  • OK. Thanks again @programmar.
    – Apostolos
    Sep 10, 2023 at 4:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .