aboutsummaryrefslogtreecommitdiff
path: root/src/voice/streamer.rs
diff options
context:
space:
mode:
authorKyle Simpson <[email protected]>2018-03-06 00:23:31 +0000
committerZeyla Hellyer <[email protected]>2018-03-05 16:23:31 -0800
commit9baf1675b0d1837fe010cfbadac8e80fd9d53898 (patch)
tree282c1b5e9291c8c10833fc5bad258412c7a4c09b /src/voice/streamer.rs
parentSupport sending files with an embed (#285) (diff)
downloadserenity-9baf1675b0d1837fe010cfbadac8e80fd9d53898.tar.xz
serenity-9baf1675b0d1837fe010cfbadac8e80fd9d53898.zip
Backport parts of 7d162b9
* Backport parts of 7d162b9. * Silent frame fixes. * Read-only playback position. * Opus Softclip for audio mixing. * Documentation for Audio structs. Not included (for now): * Bitrate control * Gutting/rework of Voice OpCodes, Heartbeats * Opus stream mixing * Minor adjustments due to manual edits.
Diffstat (limited to 'src/voice/streamer.rs')
-rw-r--r--src/voice/streamer.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/voice/streamer.rs b/src/voice/streamer.rs
index bee23ed..c5954c8 100644
--- a/src/voice/streamer.rs
+++ b/src/voice/streamer.rs
@@ -154,7 +154,12 @@ pub fn dca<P: AsRef<OsStr>>(path: P) -> StdResult<Box<AudioSource>, DcaError> {
Ok(opus(metadata.is_stereo(), reader))
}
-/// Creates an Opus audio source.
+/// Creates an Opus audio source. This makes certain assumptions: namely, that the input stream
+/// is composed ONLY of opus frames of the variety that Discord expects.
+///
+/// If you want to decode a `.opus` file, use [`ffmpeg`]
+///
+/// [`ffmpeg`]: fn.ffmpeg.html
pub fn opus<R: Read + Send + 'static>(is_stereo: bool, reader: R) -> Box<AudioSource> {
Box::new(InputSource {
stereo: is_stereo,