aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMishio595 <[email protected]>2018-08-12 13:02:23 -0600
committerMishio595 <[email protected]>2018-08-12 13:02:23 -0600
commit0801abb6f839d455ea6eb4fa962c59b07b7fd143 (patch)
treee867c2d13b11530d3e62655779c3442370bebd79
parentResolve conflicts (diff)
parentRevert "Send silence frames upon connection (Fix #301)" (diff)
downloadserenity-0801abb6f839d455ea6eb4fa962c59b07b7fd143.tar.xz
serenity-0801abb6f839d455ea6eb4fa962c59b07b7fd143.zip
Resolve conflicts
-rw-r--r--src/utils/colour.rs10
-rw-r--r--src/voice/audio.rs1
-rw-r--r--src/voice/connection.rs7
3 files changed, 9 insertions, 9 deletions
diff --git a/src/utils/colour.rs b/src/utils/colour.rs
index 54e74b0..a678a32 100644
--- a/src/utils/colour.rs
+++ b/src/utils/colour.rs
@@ -193,17 +193,19 @@ impl Colour {
/// Returns a hexadecimal string of this Colour.
///
- /// This is equivalent to passing the integer value through `std::fmt::UpperHex` with 0 padding
- /// and 6 width
+ /// This is equivalent to passing the integer value through
+ /// `std::fmt::UpperHex` with 0 padding and 6 width
///
/// # Examples
///
/// ```rust
/// use serenity::utils::Colour;
///
- /// assert_eq!(Colour::new(6573123).hex(), String::from("644C43"));
+ /// assert_eq!(Colour::new(6573123).hex(), "644C43");
/// ```
- pub fn hex(&self) -> String { format!("{:06X}", self.0) }
+ pub fn hex(&self) -> String {
+ format!("{:06X}", self.0)
+ }
}
impl From<i32> for Colour {
diff --git a/src/voice/audio.rs b/src/voice/audio.rs
index 2e15590..c556c8b 100644
--- a/src/voice/audio.rs
+++ b/src/voice/audio.rs
@@ -6,7 +6,6 @@ use std::{
pub const HEADER_LEN: usize = 12;
pub const SAMPLE_RATE: u32 = 48_000;
-pub static SILENT_FRAME: [u8; 3] = [0xf8, 0xff, 0xfe];
/// A readable audio source.
pub trait AudioSource: Send {
diff --git a/src/voice/connection.rs b/src/voice/connection.rs
index 54d9116..d1472d5 100644
--- a/src/voice/connection.rs
+++ b/src/voice/connection.rs
@@ -45,7 +45,7 @@ use std::{
},
time::Duration
};
-use super::audio::{AudioReceiver, AudioType, LockedAudio, HEADER_LEN, SAMPLE_RATE, SILENT_FRAME};
+use super::audio::{AudioReceiver, AudioType, HEADER_LEN, SAMPLE_RATE, LockedAudio};
use super::connection_info::ConnectionInfo;
use super::{payload, VoiceError, CRYPTO_MODE};
use websocket::{
@@ -200,8 +200,7 @@ impl Connection {
keepalive_timer: Timer::new(temp_heartbeat),
udp,
sequence: 0,
- // We need to send some frames to receive any audio.
- silence_frames: 100,
+ silence_frames: 0,
soft_clip,
speaking: false,
ssrc: hello.ssrc,
@@ -393,7 +392,7 @@ impl Connection {
self.silence_frames -= 1;
// Explicit "Silence" frame.
- opus_frame.extend_from_slice(&SILENT_FRAME);
+ opus_frame.extend_from_slice(&[0xf8, 0xff, 0xfe]);
} else {
// Per official guidelines, send 5x silence BEFORE we stop speaking.
self.set_speaking(false)?;