bevy/crates/bevy_audio/src
Taj Holliday 2affecdb07
Audio sink seek adopted (#18971)
Adopted #13869 

# Objective

Fixes #9076 

## Solution

Using `rodio`'s `try_seek`

## Testing

@ivanstepanovftw added a `seek` system using `AudioSink` to the
`audio_control.rs` example. I got it working with .mp3 files, but rodio
doesn't support seeking for .ogg and .flac files, so I removed it from
the commit (since the assets folder only has .ogg files). Another thing
to note is that `try_seek` fails when using `PlaybackMode::Loop`, as
`rodio::source::buffered::Buffered` doesn't support `try_seek`. I
haven't tested `SpatialAudioSink`.

## Notes

I copied the docs for `try_seek` verbatim from `rodio`, and re-exported
`rodio::source::SeekError`. I'm not completely confident in those
decisions, please let me know if I'm doing anything wrong.

</details>

---------

Co-authored-by: Ivan Stepanov <ivanstepanovftw@gmail.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>
Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
Co-authored-by: François Mockers <mockersf@gmail.com>
2025-05-03 11:29:38 +00:00
..
audio_output.rs Support decibels in bevy_audio::Volume (#17605) 2025-02-10 21:26:43 +00:00
audio_source.rs Cleanup unneeded lifetimes in bevy_asset (#15546) 2024-09-30 21:54:59 +00:00
audio.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
lib.rs Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
pitch.rs Remove all deprecated code (#16338) 2025-01-05 20:33:39 +00:00
sinks.rs Audio sink seek adopted (#18971) 2025-05-03 11:29:38 +00:00
volume.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00