Her der Töne’s comment shows you the new syntax, but you also need to activate the audio session after setCategory
:
do {
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)
try AVAudioSession.sharedInstance().setActive(true)
} catch {
print(error)
}