[][src]Function serenity::voice::ffmpeg_optioned

pub fn ffmpeg_optioned<P: AsRef<OsStr>>(
    path: P,
    args: &[&str]
) -> Result<Box<dyn AudioSource>>

Opens an audio file through ffmpeg and creates an audio source, with user-specified arguments to pass to ffmpeg.

Note that this does not build on the arguments passed by the ffmpeg function.

Examples

Pass options to create a custom ffmpeg streamer:

use serenity::voice;

let stereo_val = "2";

let streamer = voice::ffmpeg_optioned("./some_file.mp3", &[
    "-f",
    "s16le",
    "-ac",
    stereo_val,
    "-ar",
    "48000",
    "-acodec",
    "pcm_s16le",
    "-",
]);