aboutsummaryrefslogtreecommitdiff
path: root/src/ext/voice/streamer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/voice/streamer.rs')
-rw-r--r--src/ext/voice/streamer.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ext/voice/streamer.rs b/src/ext/voice/streamer.rs
index 1c08a1b..4d3b9a9 100644
--- a/src/ext/voice/streamer.rs
+++ b/src/ext/voice/streamer.rs
@@ -37,6 +37,7 @@ impl<R: Read + Send> AudioSource for PcmSource<R> {
}
}
+/// Opens an audio file through `ffmpeg` and creates an audio source.
pub fn ffmpeg<P: AsRef<OsStr>>(path: P) -> Result<Box<AudioSource>> {
let path = path.as_ref();
@@ -72,11 +73,13 @@ pub fn ffmpeg<P: AsRef<OsStr>>(path: P) -> Result<Box<AudioSource>> {
Ok(pcm(is_stereo, ChildContainer(command)))
}
+/// Creates a PCM audio source.
pub fn pcm<R: Read + Send + 'static>(is_stereo: bool, reader: R)
-> Box<AudioSource> {
Box::new(PcmSource(is_stereo, reader))
}
+/// Creates a streamed audio source with `youtube-dl` and `ffmpeg`.
pub fn ytdl(uri: &str) -> Result<Box<AudioSource>> {
let args = [
"-f",