I am constructing an audio app with XCode, utilizing the AudioPlayer class from the AudioKit bundle to deal with playback. When utilizing AudioPlayer’s search() to hunt to a particular level in an audio file, it really works, however stops the AudioPlayer from looping. Particularly, the file simply stops taking part in regardless of being set as much as return to the start as soon as completed. I’m calling the search perform solely when the participant is stopped, as calling it whereas the file is taking part in brought about different issues.
struct ContentView: View {
let participant = Participant()
var physique: some View {
VStack {
Button(motion: {
participant.audioPlayer.cease()
participant.audioPlayer.search(time: 3)
participant.audioPlayer.begin()
}) {
Textual content("Search to three seconds")
}
}
.padding()
}
}
