aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-08-11 21:00:32 -0700
committerZeyla Hellyer <[email protected]>2018-08-11 21:01:59 -0700
commit0bbe5f5dde6989a8d6a4d4910bf026b1b801fef9 (patch)
treef04a62a63ae55d02dec90849cf19283c292b749d /src
parentAdd Colour::hex (diff)
downloadserenity-0bbe5f5dde6989a8d6a4d4910bf026b1b801fef9.tar.xz
serenity-0bbe5f5dde6989a8d6a4d4910bf026b1b801fef9.zip
Revert "Send silence frames upon connection (Fix #301)"
This reverts commit 83a0c85b0bf87cb4272b5d6e189d139fc31a6d23. This makes voice sending work again.
Diffstat (limited to 'src')
-rw-r--r--src/voice/audio.rs1
-rw-r--r--src/voice/connection.rs7
2 files changed, 3 insertions, 5 deletions
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)?;