pub fn encode_samples_opus(
encoder: Encoder,
samples: &[f32],
frame_duration_ms: u32,
channels: Channels,
) -> Result<Vec<SoundPacket>>
Expand description
Encodes raw samples (f32) into a list of SoundPacket
-s.
§Behavior
Returns a list of the encoded SoundPacket
-s. The frame duration and the channels (Channels
) is needed to know the SoundPacket
’s size.
§Error
Returns an error if the following arguments are invalid: * Invalid raw samples * Invalid frame duration