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
AudioPlayer seek not working as expected while looping #2788
Comments
What happens if you call |
This does not seem to help. I tried the following things:
It does not make a difference |
Hmmm. Someone else will have to look at this. I'm can't get seek to work at all. |
The seek function might work for non-buffered audio. But because I need seamless looping I need a buffered audioplayer. Now when using the I can't seem to find any option to set a currentTime or offset for the buffered AudioPlayer. Is there another player that allows seeking with seamless looping? I noticed the AVAudioPlayer is looping seamlessly and has a seek function. But since I can't use it as a node to add the my audio flow this also does not work for me. Any suggestions? |
Correction: I don't think my original explanation below is correct. It works though. But it does not work because
|
you can try this let file = try! AVAudioFile(forReading: mediaUrl) try! player.load(file: file, buffered: true) it's work for me |
@ladeng this works when just playing it once. When 'isLooping' is enabled this does not work anymore. It will loop from the 'seek' position until end. |
macOS Version(s) Used to Build
macOS 12 Monterey
Xcode Version(s)
Xcode 14
Description
The seek function for the AudioPlayer does not work as expected when it's looping. While I would expect it to wraparound to the start it starts looping from the
seek
time to the end of the file. Source: https://github.com/AudioKit/AudioKit/blob/main/Sources/AudioKit/Nodes/Playback/AudioPlayer/AudioPlayer%2BPlayback.swift#L98Or is this actually what this function is made to do?
I noticed there was a request for this before, which was fixed. But this fix seems to have been removed after it was added at some point.
Crash Logs, Screenshots or Other Attachments (if applicable)
No response
Edit: Using buffered AudioPlayer
The text was updated successfully, but these errors were encountered: