Skip to content

Commit 8974f23

Browse files
authored
Add noise generators and improve their distribution (#755)
The improves and expands the noise generation capabilities by adding new types and fixing distribution issues in existing ones. Key changes: - Move all noise generators under `source::noise` module - Deprecate `white()` and `pink()` in favor of `noise::WhiteUniform::new()` and `noise::Pink::new()` - Add more generators: Gaussian, triangular, blue, brownian, violet, velvet - Fix white noise uniform distribution - Fix pink noise sampling rate issues - Add comprehensive tests for noise generator properties - Improve documentation with detailed usage guidance This provides a complete suite of high-quality noise generators for audio synthesis, testing, and dithering applications.
1 parent fb9e338 commit 8974f23

File tree

14 files changed

+1223
-318
lines changed

14 files changed

+1223
-318
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333
`OutputStreamConfig::buffer_size()` and `OutputStreamConfig::sample_format()` getters to access
3434
an `OutputStreamConfig`'s channel count, sample rate, buffer size and sample format values.
3535
- Added `Source::limit()` method for limiting the maximum amplitude of a source.
36+
- Added more noise generators: `WhiteGaussian`, `WhiteTriangular`, `Blue`, `Brownian`, `Violet`,
37+
and `Velvet`.
3638

3739
### Changed
3840
- Breaking: `OutputStreamBuilder` should now be used to initialize an audio output stream.
@@ -54,6 +56,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5456
- Support for decoding MP4 containers with AAC audio is now enabled by default.
5557
- Breaking: As optional features are now available: CAF and MKV containers, MP1/MP2 and ADPCM
5658
decoders. Previously, the ADPCM decoder was enabled when `symphonia-wav` was.
59+
- docs.rs will now document all features, including those that are not enabled by default.
60+
- Breaking: `WhiteNoise` and `PinkNoise` have been renamed to `noise::WhiteUniform` and
61+
`noise::Pink`.
62+
- `noise::Pink` is not deterministically seekable, so will now return `Err` when seeking.
5763

5864
### Fixed
5965
- `ChannelVolume` no longer clips/overflows when converting from many channels to
@@ -67,9 +73,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6773
- `LoopedDecoder::size_hint` now correctly indicates an infinite stream.
6874
- Symphonia decoder `total_duration` for Vorbis now return the correct value (#696).
6975
- Symphonia decoder for MP4 now seeks correctly (#577).
76+
- White noise was not correctly uniformly distributed.
77+
- Pink noise was not correctly distributed on sampling rates other than 44100 Hz.
7078

7179
### Deprecated
72-
- Deprecated `Sample::zero_value()` function in favor of `Sample::ZERO_VALUE` constant
80+
- Deprecated `Sample::zero_value()` function in favor of `Sample::ZERO_VALUE` constant.
81+
- Deprecated `white()` and `pink()` methods in favor of `noise::WhiteUniform::new()` and `noise::Pink::new()`.
7382

7483
### Removed
7584
- Breaking: Removed `Mp4Type` enum in favor of using MIME type string "audio/mp4" for MP4 format detection with `Decoder::new_mp4` (#612).

0 commit comments

Comments
 (0)