mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 14:14:21 +00:00
typos: fix in buffer and source documentation (#180)
* typos: fix in buffer and source documentation * sink: fix some formatting * sink: refer to the sink in the pause API docs
This commit is contained in:
parent
f0fc5124db
commit
8bf1bf5851
3 changed files with 12 additions and 11 deletions
|
@ -33,9 +33,9 @@ where
|
|||
///
|
||||
/// # Panic
|
||||
///
|
||||
/// - Panics if the number of channels is zero.
|
||||
/// - Panics if the samples rate is zero.
|
||||
/// - Panics if the length of the buffer is superior to approximatively 16 billion elements.
|
||||
/// - Panicks if the number of channels is zero.
|
||||
/// - Panicks if the samples rate is zero.
|
||||
/// - Panicks if the length of the buffer is larger than approximatively 16 billion elements.
|
||||
/// This is because the calculation of the duration would overflow.
|
||||
///
|
||||
pub fn new<D>(channels: u16, sample_rate: u32, data: D) -> SamplesBuffer<S>
|
||||
|
|
11
src/sink.rs
11
src/sink.rs
|
@ -93,14 +93,14 @@ impl Sink {
|
|||
|
||||
/// Changes the volume of the sound.
|
||||
///
|
||||
/// The value `1.0` is the "normal" volume (unfiltered input). Any value other than 1.0 will
|
||||
/// The value `1.0` is the "normal" volume (unfiltered input). Any value other than `1.0` will
|
||||
/// multiply each sample by this value.
|
||||
#[inline]
|
||||
pub fn set_volume(&mut self, value: f32) {
|
||||
*self.controls.volume.lock().unwrap() = value;
|
||||
}
|
||||
|
||||
/// Resumes playback of a paused sound.
|
||||
/// Resumes playback of a paused sink.
|
||||
///
|
||||
/// No effect if not paused.
|
||||
#[inline]
|
||||
|
@ -112,14 +112,15 @@ impl Sink {
|
|||
///
|
||||
/// No effect if already paused.
|
||||
///
|
||||
/// A paused sound can be resumed with `play()`.
|
||||
/// A paused sink can be resumed with `play()`.
|
||||
pub fn pause(&self) {
|
||||
self.controls.pause.store(true, Ordering::SeqCst);
|
||||
}
|
||||
|
||||
/// Gets if a sound is paused
|
||||
/// Gets if a sink is paused
|
||||
///
|
||||
/// Sounds can be paused and resumed using pause() and play(). This gets if a sound is paused.
|
||||
/// Sinks can be paused and resumed using `pause()` and `play()`. This returns `true` if the
|
||||
/// sink is paused.
|
||||
pub fn is_paused(&self) -> bool {
|
||||
self.controls.pause.load(Ordering::SeqCst)
|
||||
}
|
||||
|
|
|
@ -95,9 +95,9 @@ mod zero;
|
|||
///
|
||||
/// The three characteristics that describe a sound are provided through this trait:
|
||||
///
|
||||
/// - The number of channels can be retreived with `channels`.
|
||||
/// - The frequency can be retreived with `sample_rate`.
|
||||
/// - The list of values can be retreived by iterating on the source. The `Source` trait requires
|
||||
/// - The number of channels can be retrieved with `channels`.
|
||||
/// - The frequency can be retrieved with `sample_rate`.
|
||||
/// - The list of values can be retrieved by iterating on the source. The `Source` trait requires
|
||||
/// that the `Iterator` trait be implemented as well.
|
||||
///
|
||||
/// # Frames
|
||||
|
|
Loading…
Reference in a new issue