Closed NewajShovo closed 12 months ago
func playNextFile() {
currentTime = 0.0
if currentFileIndex < 4 {
print("Starting if block");
currentFileIndex += 1
player = AudioPlayer();
try? player.load(url: fileURL[currentFileIndex])
engine.output = player
player.play();
player.completionHandler = playNextFile
} else {
print("Starting else block");
currentFileIndex = 0
player = AudioPlayer();
try? player.load(url: fileURL[currentFileIndex])
engine.output = player
player.play();
player.completionHandler = playNextFile
}
}
Changing playNextFile function like the above solve the problem.
This doesn't seem to be an issue with the Cookbook per se and it doesn't seem to be a good solution either. You're changing the signal graph on playing a file.
macOS Version(s) Used to Build
macOS 13 Ventura
Xcode Version(s)
Xcode 14
Description
Expected: All audio will be played one by one. Found: First and second files can only be heard, other audio files are not being played.
Crash Logs, Screenshots or Other Attachments (if applicable)
No response