Skip to content
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

build(deps): bump kira from 0.9.6 to 0.10.0 #567

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 7, 2025

Bumps kira from 0.9.6 to 0.10.0.

Release notes

Sourced from kira's releases.

v0.10.0

Buffered audio

Kira now processes audio in chunks instead of one sample at a time. This means that Sound::process no longer returns a Frame; instead it receives a slice of Frames to overwrite. Effect::process takes an input slice instead of a single frame, and it overwrites that slice instead of returning a new Frame.

The benefit of this change is significantly improved performance. The criterion benchmarks aren't comparable to the ones in v0.9.x and earlier, but in my unscientific test, I can play about twice as many sounds on my PC without crackling.

There are some tradeoffs, but I think they're reasonable:

  • Modulators are no longer sample accurate. Instead, they update once per internal processing chunk. Sounds and effects can interpolate between the previous and current modulator value using Parameter::interpolated_value to avoid discontinuities.
  • Clocks are no longer sample accurate. For my use case which involves dynamically generating music, the default internal buffer size of 128 frames sounds almost exactly the same as sample-accurate clocks. You can adjust the internal buffer size to get the right tradeoff of performance vs. accuracy for your game. I have some ideas for how sample-accurate clocks could be implemented within the buffered architecture, so if you find yourself needing sample-accurate clocks, let me know!
  • The delay effect can no longer have its delay time changed after the fact. If you know how to implement a delay that can smoothly change its delay time with the buffered architecture, please make a PR!

Hierarchical mixer

Sounds now live inside mixer tracks. Previously, to play a sound on a mixer track, you would use StaticSoundData/StreamingSoundData::output_destination. Now, you pass the sound to TrackHandle::play. Additionally, tracks can contain other tracks. Tracks can also route their outputs to send tracks, which are a separate concept now. This change enables the following feature:

Pausing and resuming mixer tracks

Mixer tracks can now be paused and resumed. Pausing a mixer track pauses all sounds playing on the track, as well as all child tracks.

Spatial audio overhaul

The concepts of spatial scenes and emitters have been removed, and listeners no longer output to a mixer track. Instead, mixer tracks can optionally have spatial properties, like position and spatialization strength. Sounds and child tracks on the track will have spatialization applied relative to a specified listener.

This release also adds Value::FromListenerDistance, which can be used to map sound and effect parameters to the distance between a spatial track and its corresponding listener.

Simplified volume and playback rate types

Previously, Volume was an enum with Amplitude and Decibels variants, and PlaybackRate was an enum with Factor and Semitones variants. There's a couple problems with this:

  • It's unclear what scale a tween uses when tweening from one variant to another. For instance, if you tween a Volume::Amplitude to a Volume::Decibels with linear easing, is it linear in the amplitude domain or decibels?
  • Amplitude isn't a good default representation for volume because it's not perceptually linear.

Now, everything that previously used Volume uses the simpler Decibels type, and PlaybackRate always contains a factor. (Semitones still exists as a separate type that implements Into<PlaybackRate>).

There's also a new Panning type that's used instead of bare f64s. Panning has been changed so -1.0 is left instead of 0.0, since this makes more sense mathematically.

Other changes

  • Reorganized some types and modules to reduce unnecessary nesting
  • Added WaitingToResume and Resuming variants to PlaybackState
  • Changes to Mapping:
    • Added an easing field
    • Inputs are now always clamped to the input range
    • Removed the Default implementation
    • Added methods for performing math operations on the output range
  • Implemented some math operations to Value
  • Changed the fields of Capacities back to u64s
  • ClockInfoProvider and ModulatorValueProvider and now combined into one

... (truncated)

Changelog

Sourced from kira's changelog.

v0.10 - January 1, 2025

Buffered audio

Kira now processes audio in chunks instead of one sample at a time. This means that Sound::process no longer returns a Frame; instead it receives a slice of Frames to overwrite. Effect::process takes an input slice instead of a single frame, and it overwrites that slice instead of returning a new Frame.

The benefit of this change is significantly improved performance. The criterion benchmarks aren't comparable to the ones in v0.9.x and earlier, but in my unscientific test, I can play about twice as many sounds on my PC without crackling.

There are some tradeoffs, but I think they're reasonable:

  • Modulators are no longer sample accurate. Instead, they update once per internal processing chunk. Sounds and effects can interpolate between the previous and current modulator value using Parameter::interpolated_value to avoid discontinuities.
  • Clocks are no longer sample accurate. For my use case which involves dynamically generating music, the default internal buffer size of 128 frames sounds almost exactly the same as sample-accurate clocks. You can adjust the internal buffer size to get the right tradeoff of performance vs. accuracy for your game. I have some ideas for how sample-accurate clocks could be implemented within the buffered architecture, so if you find yourself needing sample-accurate clocks, let me know!
  • The delay effect can no longer have its delay time changed after the fact. If you know how to implement a delay that can smoothly change its delay time with the buffered architecture, please make a PR!

Hierarchical mixer

Sounds now live inside mixer tracks. Previously, to play a sound on a mixer track, you would use StaticSoundData/StreamingSoundData::output_destination. Now, you pass the sound to TrackHandle::play. Additionally, tracks can contain other tracks. Tracks can also route their outputs to send tracks, which are a separate concept now. This change enables the following feature:

Pausing and resuming mixer tracks

Mixer tracks can now be paused and resumed. Pausing a mixer track pauses all sounds playing on the track, as well as all child tracks.

Spatial audio overhaul

The concepts of spatial scenes and emitters have been removed, and listeners no longer output to a mixer track. Instead, mixer tracks can optionally have spatial properties, like position and spatialization strength. Sounds and child tracks on the track will have spatialization applied relative to a specified listener.

This release also adds Value::FromListenerDistance, which can be used to map sound and effect parameters to the distance between a spatial track and its corresponding listener.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [kira](https://github.com/tesselode/kira) from 0.9.6 to 0.10.0.
- [Release notes](https://github.com/tesselode/kira/releases)
- [Changelog](https://github.com/tesselode/kira/blob/main/changelog.md)
- [Commits](tesselode/kira@v0.9.6...v0.10.0)

---
updated-dependencies:
- dependency-name: kira
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jan 7, 2025
Copy link
Contributor Author

dependabot bot commented on behalf of github Jan 9, 2025

Superseded by #568.

@dependabot dependabot bot closed this Jan 9, 2025
@dependabot dependabot bot deleted the dependabot/cargo/kira-0.10.0 branch January 9, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants