pub struct Audio {
pub sender_session: u32,
pub frame_number: u64,
pub opus_data: Vec<u8>,
pub positional_data: Vec<f32>,
pub volume_adjustment: f32,
pub is_terminator: bool,
pub header: Option<Header>,
}Fields§
§sender_session: u32The session of the client (sender) this audio was originally sent from. This field is not required when sending audio to the server, but will always be set when receiving audio from the server.
frame_number: u64The number of the first contained audio frame (indicating the position of that frame in the overall audio stream)
opus_data: Vec<u8>The actual voice data payload in the Opus format.
positional_data: Vec<f32>Optional positional data indicating the speaker’s position in a virtual world (in meters). This “list” is really expected to be an array of size 3 containing the X, Y and Z coordinates of the position (in that order).
volume_adjustment: f32A volume adjustment determined by the server for this audio packet. It is up to the client to apply this adjustment to the resulting audio (or not). Note: A value of 0 means that this field is unset.
is_terminator: boolA flag indicating whether this audio packet represents the end of transmission for the current audio stream
header: Option<Header>Trait Implementations§
Source§impl Message for Audio
impl Message for Audio
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.