Skip to content

Conversation

taj-holliday
Copy link
Contributor

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.

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@ickshonpe ickshonpe added C-Feature A new feature, making something new possible A-Audio Sounds playback and modification S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 29, 2025
@janhohenheim janhohenheim added the D-Trivial Nice and easy! A great choice to get started with Bevy label May 3, 2025
mockersf and others added 2 commits May 3, 2025 11:21
@mockersf mockersf enabled auto-merge May 3, 2025 09:22
@janhohenheim janhohenheim added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 3, 2025
@mockersf mockersf added this pull request to the merge queue May 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2025
@mockersf mockersf added this pull request to the merge queue May 3, 2025
Merged via the queue into bevyengine:main with commit 2affecd May 3, 2025
34 checks passed
@github-project-automation github-project-automation bot moved this to Done in Audio May 3, 2025
andrewzhurov pushed a commit to andrewzhurov/bevy that referenced this pull request May 17, 2025
Adopted bevyengine#13869 

# Objective

Fixes bevyengine#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Audio Sounds playback and modification C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add support for seeking audio.
5 participants