Struct libpulse_binding::sample::Spec
source ·
[−]Expand description
A sample format and attribute specification.
Fields
format: Format
The sample format.
rate: u32
The sample rate. (e.g. 44100).
channels: u8
Audio channels. (1 for mono, 2 for stereo, …).
Implementations
Maximum number of allowed channels.
Initializes the specified sample spec.
The sample spec will have a defined state but is_valid()
will fail for
it.
This is supported on crate feature pa_v5
only.
pa_v5
only.Checks only if the format attribute is valid.
Or in other words that the client library running on the end user system accepts it.
This is supported on crate feature pa_v5
only.
pa_v5
only.Checks only if the rate is within the supported range.
This is supported on crate feature pa_v5
only.
pa_v5
only.Checks only if the channel count is within the supported range.
Gets the amount of bytes that constitute playback of one second of audio, with the specified sample type.
Gets the size of a frame.
Gets the size of a sample.
Calculates the time it would take to play a buffer of the specified size.
The return value will always be rounded down for non-integral return values.
Note, the underlying calculation may overflow for very large values.
Calculates the size of a buffer required, for playback duration of the time specified.
The return value will always be rounded down for non-integral return values.
Note, the underlying calculation may overflow for very large values.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Spec
impl UnwindSafe for Spec
Blanket Implementations
Mutably borrows from an owned value. Read more