Fix voice_simple example

This commit is contained in:
kozabrada123 2024-07-25 11:27:30 +02:00
parent feb2b1b64c
commit 539460a552
2 changed files with 2153 additions and 7 deletions

2148
examples/voice_simple/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -22,11 +22,9 @@ use simplelog::{TermLogger, Config, WriteLogger};
use std::{net::SocketAddrV4, sync::Arc, fs::File, time::Duration};
use chorus::{
gateway::{Observer, Gateway},
gateway::{Gateway, GatewayOptions, Observer},
types::{
GatewayReady, SelectProtocol, SelectProtocolData, SessionDescription, Snowflake, Speaking,
SpeakingBitflags, SsrcDefinition, VoiceEncryptionMode, VoiceIdentify, VoiceProtocol,
VoiceReady, VoiceServerUpdate, GatewayIdentifyPayload, UpdateVoiceState,
GatewayIdentifyPayload, GatewayReady, SelectProtocol, SelectProtocolData, SessionDescription, Snowflake, Speaking, SpeakingBitflags, SsrcDefinition, UpdateVoiceState, VoiceEncryptionMode, VoiceIdentify, VoiceProtocol, VoiceReady, VoiceServerUpdate
},
voice::{
gateway::{VoiceGateway, VoiceGatewayHandle},
@ -219,7 +217,7 @@ impl Observer<Speaking> for VoiceHandler {
println!(
"Received Speaking! (SRRC: {}, flags: {:?})",
data.ssrc,
SpeakingBitflags::from_bits(data.speaking).unwrap()
SpeakingBitflags::from_bits(data.speaking.into()).unwrap()
);
}
}
@ -253,7 +251,7 @@ async fn main() {
])
.unwrap();
let gateway = Gateway::spawn(GATEWAY_URL.to_string())
let gateway = Gateway::spawn(GATEWAY_URL.to_string(), GatewayOptions::default())
.await
.unwrap();