Skip to content

Commit d1dd377

Browse files
committed
refactor: rename integer-samples feature to integer-decoder
Renamed the "integer-samples" feature flag to "integer-decoder" to better reflect its purpose of controlling decoder output format rather than general sample handling. - Renamed feature flag in Cargo.toml - Updated corresponding cfg attributes in source code - Updated documentation to reflect the new feature name - Maintains same functionality of switching between i16/f32 decoder output This change makes the feature's purpose more explicit and matches the component it affects.
1 parent 32ba0f0 commit d1dd377

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
- Breaking: `Sink::try_new` renamed to `connect_new` and does not return error anymore.
2828
`Sink::new_idle` was renamed to `new`.
2929
- Breaking: In the `Source` trait, the method `current_frame_len()` was renamed to `current_span_len()`.
30-
- Breaking: `Decoder` now outputs `f32` samples instead of `i16`.
30+
- Breaking: `Decoder` now outputs `f32` samples by default instead of `i16`.
31+
Enable the `integer-decoder` to revert to `i16` samples.
3132
- The term 'frame' was renamed to 'span' in the crate and documentation.
3233

3334
### Fixed
3435
- Symphonia decoder `total_duration` incorrect value caused by conversion from `Time` to `Duration`.
3536
- An issue with `SignalGenerator` that caused it to create increasingly distorted waveforms
3637
over long run times has been corrected. (#201)
37-
- WAV and FLAC decoder duration calculation now calculated once and handles very large files correctly
38-
- Removed unwrap() calls in MP3, WAV and FLAC format detection for better error handling
38+
- WAV and FLAC decoder duration calculation now calculated once and handles very large files
39+
correctly
40+
- Removed unwrap() calls in MP3, WAV, FLAC and Vorbis format detection for better error handling
3941

4042
### Deprecated
4143
- Deprecated `Sample::zero_value()` function in favor of `Sample::ZERO_VALUE` constant

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ default = ["playback", "flac", "vorbis", "wav", "mp3"]
3030
tracing = ["dep:tracing"]
3131
experimental = ["dep:atomic_float"]
3232
playback = ["dep:cpal"]
33-
integer-samples = []
33+
integer-decoder = []
3434

3535
flac = ["claxon"]
3636
vorbis = ["lewton"]

src/decoder/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ mod vorbis;
3131
#[cfg(all(feature = "wav", not(feature = "symphonia-wav")))]
3232
mod wav;
3333

34-
#[cfg(feature = "integer-samples")]
34+
#[cfg(feature = "integer-decoder")]
3535
/// Output format of the decoders.
3636
pub type DecoderSample = i16;
37-
#[cfg(not(feature = "integer-samples"))]
37+
#[cfg(not(feature = "integer-decoder"))]
3838
/// Output format of the decoders.
3939
pub type DecoderSample = f32;
4040

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@
142142
//!
143143
//! The "playback" feature adds support for playing audio. This feature requires the "cpal" crate.
144144
//!
145-
//! ### Feature "integer-samples"
145+
//! ### Feature "integer-decoder"
146146
//!
147-
//! The "integer-samples" changes the output format of the decoders to use `i16` instead of `f32`.
147+
//! The "integer-decoder" changes the output format of the decoders to use `i16` instead of `f32`.
148148
//! This is useful if you want to decode audio on an exotic, low-spec or old device that does not
149149
//! have hardware support for floating-point operations.
150150
//!

0 commit comments

Comments
 (0)