Skip to content

Commit

Permalink
Fix doc typo, consistent naming with MixMode.
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Nov 14, 2024
1 parent 51267ca commit 14d7f20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/driver/decode_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum Channels {
Mono,
/// Decode received audio packets into two interleaved channels.
///
/// Received mono packets will automatically be duplicated across
/// Received mono packets' samples will automatically be duplicated across
/// both channels.
///
/// The default choice.
Expand All @@ -44,7 +44,7 @@ pub enum Channels {
}

impl Channels {
pub(crate) fn n_channels(self) -> usize {
pub(crate) fn channels(self) -> usize {
match self {
Channels::Mono => 1,
Channels::Stereo => 2,
Expand All @@ -69,7 +69,7 @@ pub enum SampleRate {
Hz8000,
/// Decode to a sample rate of 12kHz.
Hz12000,
/// Decode to a sample rate of 46kHz.
/// Decode to a sample rate of 16kHz.
Hz16000,
/// Decode to a sample rate of 24kHz.
Hz24000,
Expand Down
2 changes: 1 addition & 1 deletion src/driver/tasks/udp_rx/ssrc_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl SsrcState {
Ok(audio_len) => {
// Decoding to stereo: audio_len refers to sample count irrespective of channel count.
// => multiply by number of channels.
out.truncate(self.channels.n_channels() * audio_len);
out.truncate(self.channels.channels() * audio_len);

break;
},
Expand Down

0 comments on commit 14d7f20

Please sign in to comment.