Skip to content

Release 0.21.0 #721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Version [0.21] (TODO)

### Added
- Added `Source::amplify_decibel()` method to control volume by decibels.
- Added `Source::amplify_normalized()` method to perceptually modify volume.
Expand Down Expand Up @@ -40,6 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Breaking: `ReadSeekSource::new()` now takes `Settings`.
- Breaking: Sources now use `f32` samples. To convert to and from other types of samples use
functions from `dasp_sample` crate. For example `DaspSample::from_sample(sample)`.
- Breaking: `symphonia::SeekError` has a new variant `AccurateSeekNotSupported`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also want to add:

Breaking: `symphonia::SeekError` has a new variant `RandomAccessNotSupported`. This error usually means that you are trying to seek backward without `is_seekable` or `byte_len` set: use `Decoder::try_from` or `DecoderBuilder` for that.

and variants `Retrying` and `Refining` have been removed. Catching this error
may allow a caller to retry in coarse seek mode.

### Fixed
- `ChannelVolume` no longer clips/overflows when converting from many channels to
Expand All @@ -51,7 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
correctly.
- Removed unwrap() calls in MP3, WAV, FLAC and Vorbis format detection for better error handling.
- `LoopedDecoder::size_hint` now correctly indicates an infinite stream.
- Symphonia decoder `total_duration` for Vorbis now return the correct value (#696).
- Symphonia decoder `total_duration` no longer returns None when it could
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: want to use None and Some (with backticks?)

return Some
- Symphonia decoder for MP4 now seeks correctly (#577).

### Deprecated
Expand All @@ -60,12 +66,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- Breaking: Removed `Mp4Type` enum in favor of using MIME type string "audio/mp4" for MP4 format detection with `Decoder::new_mp4` (#612).

# Version 0.20.1 (2024-11-08)
## Version [0.20.1] - 2024-11-08

### Fixed
- Builds without the `symphonia` feature did not compile

# Version 0.20.0 (2024-11-08)
## Version [0.20.0] - 2024-11-08

### Added
- Support for *ALAC/AIFF*
Expand Down Expand Up @@ -93,7 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- `SamplesBuffer` is now `Clone`

# Version 0.19.0 (2024-06-29)
## Version [0.19.0] - 2024-06-29

### Added
- Adds a new source `track_position`. It keeps track of duration since the
Expand All @@ -103,12 +109,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mp4a with decodable tracks after undecodable tracks now play. This matches
VLC's behaviour.

# Version 0.18.1 (2024-05-23)
## Version [0.18.1] - 2024-05-23

### Fixed
- Seek no longer hangs if the sink is empty.

# Version 0.18.0 (2024-05-05)
## Version [0.18.0] - 2024-05-05

### Changed
- `Source` trait is now also implemented for `Box<dyn Source>` and `&mut Source`
Expand All @@ -129,32 +135,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `mp3::is_mp3()` no longer changes the position in the stream when the stream
is mp3

# Version 0.17.3 (2023-10-23)
## Version [0.17.3] - 2023-10-23

- Build fix for `minimp3` backend.

# Version 0.17.2 (2023-10-17)
## Version [0.17.2] - 2023-10-17

- Add `EmptyCallback` source.
- Fix index out of bounds bug.
- Use non-vulnerable `minimp3` fork.
- Add filter functions with additional q parameter.

# Version 0.17.1 (2023-02-25)
## Version [0.17.1] - 2023-02-25

- Disable `symphonia`'s default features.

# Version 0.17.0 (2023-02-17)
## Version [0.17.0] - 2023-02-17

- Update `cpal` to [0.15](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0150-2022-01-29).
- Default to `symphonia` for mp3 decoding.

# Version 0.16.0 (2022-09-14)
## Version [0.16.0] - 2022-09-14

- Update `cpal` to [0.14](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0140-2022-08-22).
- Update `symphonia` to [0.5](https://github.com/pdeljanov/Symphonia/releases/tag/v0.5.1).

# Version 0.15.0 (2022-01-23)
## Version [0.15.0] - 2022-01-23

- Remove requirement that the argument `Decoder::new` and `LoopedDecoder::new` implement `Send`.
- Add optional symphonia backend.
Expand All @@ -163,57 +169,57 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `SineWave::new()` now takes a `f32` instead of a `u32`.
- Add `len()` method to `SpatialSink`.

# Version 0.14.0 (2021-05-21)
## Version [0.14.0] - 2021-05-21

- Re-export `cpal` in full.
- Replace panics when calling `OutputStream::try_default`, `OutputStream::try_from_device` with new
`StreamError` variants.
- `OutputStream::try_default` will now fallback to non-default output devices if an `OutputStream`
cannot be created from the default device.

# Version 0.13.1 (2021-03-28)
## Version [0.13.1] - 2021-03-28

- Fix panic when no `pulseaudio-alsa` was installed.

# Version 0.13.0 (2020-11-03)
## Version [0.13.0] - 2020-11-03

- Update `cpal` to [0.13](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0130-2020-10-28).
- Add Android support.

# Version 0.12.0 (2020-10-05)
## Version [0.12.0] - 2020-10-05

- Breaking: Update `cpal` to [0.12](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0120-2020-07-09).
- Breaking: Rework API removing global "rodio audio processing" thread & adapting to the upstream cpal API changes.
- Add new_X format specific methods to Decoder.
- Fix resampler dependency on internal `Vec::capacity` behaviour.

# Version 0.11.0 (2020-03-16)
## Version [0.11.0] - 2020-03-16

- Update `lewton` to [0.10](https://github.com/RustAudio/lewton/blob/master/CHANGELOG.md#release-0100---january-30-2020).
- Breaking: Update `cpal` to [0.11](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0110-2019-12-11)

# Version 0.10.0 (2019-11-16)
## Version [0.10.0] - 2019-11-16

- Removal of nalgebra in favour of own code.
- Fix a bug that switched channels when resuming after having paused.
- Attempt all supported output formats if the default format fails in `Sink::new`.
- Breaking: Update `cpal` to [0.10](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md#version-0100-2019-07-05).

# Version 0.9.0 (2019-06-08)
## Version [0.9.0] - 2019-06-08

- Remove exclusive `&mut` borrow requirements in `Sink` & `SpatialSink` setters.
- Use `nalgebra` instead of `cgmath` for `Spatial` source.

# Version 0.8.1 (2018-09-18)
## Version [0.8.1] - 2018-09-18

- Update `lewton` dependency to [0.9](https://github.com/RustAudio/lewton/blob/master/CHANGELOG.md#release-090---august-16-2018)
- Change license from `Apache-2.0` only to `Apache-2.0 OR MIT`

# Version 0.8.0 (2018-06-22)
## Version [0.8.0] - 2018-06-22

- Add mp3 decoding capabilities via `minimp3`

# Version 0.7.0 (2018-04-19)
## Version [0.7.0] - 2018-04-19

- Update `cpal` dependency to 0.8, and adopt the new naming convention
- BREAKING CHANGES:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rodio"
version = "0.20.1"
version = "0.21.0"
license = "MIT OR Apache-2.0"
description = "Audio playback library"
keywords = ["audio", "playback", "gamedev"]
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ See [the docs](https://docs.rs/rodio/latest/rodio/#alternative-decoder-backends)

[The documentation](http://docs.rs/rodio) contains an introduction to the library.

# [Breaking Changes](UPGRADE.md)
We have written an upgrade [guide](UPGRADE.md), it will help you upgrade to rodio 0.21.

# [Examples](https://github.com/RustAudio/rodio/tree/f1eaaa4a6346933fc8a58d5fd1ace170946b3a94/examples)

We are currently making large improvements to rodio. This does mean the updated examples do not work with the current crates.io release. You will have to look at the examples from commit `f1eaaa4a`. They are available [on github](https://github.com/RustAudio/rodio/tree/f1eaaa4a6346933fc8a58d5fd1ace170946b3a94/examples).
We are always making changes to rodio. This can mean that the examples do not work with the current crates.io release. You will have to look at the examples from commit `f1eaaa4a`. They are available [on github](https://github.com/RustAudio/rodio/tree/f1eaaa4a6346933fc8a58d5fd1ace170946b3a94/examples).

## Requirements

Expand All @@ -41,7 +44,7 @@ It is possible to build `rodio` without support for audio playback. In this conf
In order to use `rodio` in this configuration disable default features and add the necessary ones. In this case the `Cargo.toml` dependency would look like:
```toml
[dependencies]
rodio = { version = "0.20.1", default-features = false, features = ["symphonia-all"] }
rodio = { version = "0.21.0", default-features = false, features = ["symphonia-all"] }
```
### Cross compling aarch64/arm

Expand Down
64 changes: 54 additions & 10 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,63 @@
This guide will help you update your code when upgrading from older versions of rodio.

# rodio 0.20.1 or earlier to current GitHub version
# rodio 0.21 to current GitHub version

nothing

# rodio 0.20 or earlier to 0.21

## Features
- If you use disable the rodio features with `default_features = false` in
`Cargo.toml` you need to add a new feature `playback`.
- If you disable the rodio default features with `default_features = false` in `Cargo.toml` you need to add a new feature `playback`.

## Source implementations
- Source had a required method `current_frame_len`. In the latest version of rodio *frame* has been renamed to *span*. You will need to change every occurrence of `current_frame_len` to `current_span_len`.
- Source was generic over sample type. It no longer is.
- Remove any generics (`::<f32>`, `::<u16>` or `::<i16>`) that cause errors.
- Remove `SampleConvertor` it is no longer needed and has been removed.
- Remove any calls to `source.convert_samples()` they are no longer needed and
removed

## OutputStream
- The outputstream is now more configurable. Where you used `OutputStream::try_default()` you have a choice:
- *(recommended)* Get an error when the default stream could not be opened: `OutputStreamBuilder::open_default_stream()?`
- Stay close to the old behavior using:
`OutputStreamBuilder::open_stream_or_fallback()`, which tries to open the
default (audio) stream. If that fails it tries all other combinations of
device and settings. The old behavior was only trying all settings of the
default device.
The output stream is now more configurable. Where you used `OutputStream::try_default()` you have a choice:
- *(recommended)* Get an error when the default stream could not be opened: `OutputStreamBuilder::open_default_stream()?`
- Stay close to the old behavior using: `OutputStreamBuilder::open_stream_or_fallback()`, which tries to open the default (audio) stream. If that fails it tries all other combinations of device and settings. The old behavior was only trying all settings of the default device.

## Sink & SpatialSink
- Replace `Sink::try_new` with `sink::connect_new`. It now takes an `&Mixer`
instead of a `OutputStreamHandle`. You get an `&Mixer` by calling `mixer()` on
`OutputStream`.
- Replace `Sink::new_idle` with `Sink::new`,

### Example
The following Rodio *0.20.1* code:
```rust
let (_stream, handle) = rodio::OutputStream::try_default()?;
let sink = rodio::Sink::try_new(&handle)?;
```
Should be written like this in Rodio *0.21.0*:
```rust
let stream_handle = rodio::OutputStreamBuilder::open_default_stream()?;
let sink = rodio::Sink::connect_new(stream_handle.mixer());
```

The `SpatialSink` changes mirror those in `Sink` described above.

## Dynamic mixer
Replace `DynamicMixerController` with `Mixer` and `DynamicMixer` with `MixerSource`.

## Decoder
- `Decoder::new_mp4` no longer takes an `Mp4Type` as hint. You can remove the argument
- Symphonia now longer assumes all sources are seek-able. Use
`DecoderBuilder::with_seekable` or `try_from` on a `File` or `Bufreader`.

The following Rodio *0.20.1* code
```rust
let file = File::open("music.ogg")?;
let reader = BufReader::new(file);
let source = Decoder::new(reader);
```
Should be written like this in Rodio *0.21.0*:
```rust
let file = File::open("music.ogg")?;
let source = Decoder::try_from(music.ogg)?;
```
30 changes: 30 additions & 0 deletions outreach/v0.21_announcement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!---
When 0.21.0 is released this announcement will be posted to r/rust and the
rust user forum. Also post in rust audio discord: https://discord.gg/8qW6q2k
-->

# Announcing rodio 0.21

Rodio is an audio playback library. It can decode audio files, synthesize new
sounds, apply effects to sounds & mix them. Rodio has been part of the Rust
ecosystem for 9 years now! 🎉.

## New release
It's been 5 months since our last release. Since the our team has grown to 3
maintainers! Thank you Petr and Roderick! And a big thanks for the countless
other contributors helping out. Thanks to you all this release:

- Makes the API easier to use:
- Its now impossible to accidentally drop the `Outputstream`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately this is not true, I must have misremembered... (at least a quick check with the music_flac example shows it to be false)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay got a solution for this, see #746 and #747 and let me know which you prefer.

- Our types are no longer generic over sample type.
- Adds new functionality:
- Amplify using decibals or perceptually.
- Add a distortion effect.
- You can use rodio without `cpal` to generate `wav` files!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to highlight the decoder builder as well?


There have also been many fixes and smaller additions, take a look at the
[changelog](https://github.com/RustAudio/rodio/blob/89dac52/CHANGELOG.md)!

## The future
The rust audio organization will keep working on audio in Rust. We hope to
release an announcement regarding that soon!