Skip to content

Commit d9818ce

Browse files
committed
feat(decoders)!: implement comprehensive seeking and bit depth detection for all decoders
Major decoder enhancements implementing universal try_seek() support, bit depth detection, and changing decoder selection to prioritize alternative decoders over Symphonia. Key changes: - Universal seeking: All decoders implement try_seek() with SeekMode configuration - Bit depth detection: Added Source::bits_per_sample() for lossless formats - Decoder precedence: Alternative decoders now tried before Symphonia decoders - Enhanced DecoderBuilder: Added scan_duration, total_duration, seek_mode settings - Critical fix: Resolved zero span length issue in Symphonia Ogg Vorbis decoder - Performance: Optimized Vorbis, FLAC, and WAV decoder implementations BREAKING CHANGES: - SeekError::NotSupported renamed to SeekError::SeekingNotSupported - WavDecoder no longer implements ExactSizeIterator - Alternative decoders now take precedence when multiple format features enabled - DecoderBuilder::with_coarse_seek deprecated for with_seek_mode Closes: - #190 - #775
1 parent 47dab16 commit d9818ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6424
-971
lines changed

CHANGELOG.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## Unreleased
1111

1212
### Added
13-
1413
- `Chirp` now implements `Iterator::size_hint` and `ExactSizeIterator`.
1514
- Added `Red` noise generator that is more practical than `Brownian` noise.
1615
- Added `std_dev()` to `WhiteUniform` and `WhiteTriangular`.
1716
- Added a macro `nz!` which facilitates creating NonZero's for `SampleRate` and
1817
`ChannelCount`.
19-
- Adds a new input source: Microphone.
20-
- Adds a new method on source: record which collects all samples into a
21-
SamplesBuffer.
18+
- Adds a new input source: `Microphone`.
19+
- Adds a new method on source: `record` which collects all samples into a
20+
`SamplesBuffer`.
2221
- Adds `wav_to_writer` which writes a `Source` to a writer.
22+
- All decoders implement `try_seek()`.
23+
- Added `Source::bits_per_sample()` method for lossless formats (FLAC, WAV).
24+
- Added `SeekMode` enum (`Fastest`/`Nearest`) and DecoderBuilder methods:
25+
- `with_seek_mode()` - Configure seeking precision.
26+
- `with_total_duration()` - Provide pre-computed duration to avoid scanning.
27+
- `with_scan_duration()` - Enable file scanning for duration computation.
28+
- All alternative decoders now support `Settings` via `new_with_settings()`.
29+
- Symphonia decoder handles multi-track containers and chained Ogg streams.
30+
31+
### Changed
32+
- `output_to_wav` renamed to `wav_to_file` and now takes ownership of the `Source`.
33+
- `Blue` noise generator uses uniform instead of Gaussian noise for better performance.
34+
- `Gaussian` noise generator has standard deviation of 0.6 for perceptual equivalence.
35+
- Alternative decoders (`hound`, `claxon`, `lewton`, `minimp3`) now take precedence over Symphonia
36+
decoders when both features are enabled.
37+
- Breaking: `SeekError::NotSupported` renamed to `SeekError::SeekingNotSupported`.
38+
- Improved `size_hint()` accuracy across all decoders.
39+
- Improved decoder memory allocations and efficiency
40+
41+
### Deprecated
42+
- `DecoderBuilder::with_coarse_seek()` in favor of `with_seek_mode(SeekMode::Fastest)`.
2343

2444
### Fixed
2545
- docs.rs will now document all features, including those that are optional.
2646
- `Chirp::next` now returns `None` when the total duration has been reached, and will work
2747
correctly for a number of samples greater than 2^24.
2848
- `PeriodicAccess` is slightly more accurate for 44.1 kHz sample rate families.
49+
- Fixed Symphonia Ogg Vorbis decoder returning zero span length that broke buffered sources and
50+
effects.
2951

30-
### Changed
31-
- `output_to_wav` renamed to `wav_to_file` and now takes ownership of the `Source`.
32-
- `Blue` noise generator uses uniform instead of Gaussian noise for better performance.
33-
- `Gaussian` noise generator has standard deviation of 0.6 for perceptual equivalence.
52+
### Removed
53+
- `WavDecoder` no longer implements `ExactSizeIterator`.
54+
- `Source::source_intact` removed.
3455

3556
## Version [0.21.1] (2025-07-14)
3657

0 commit comments

Comments
 (0)