Post

Replies

Boosts

Views

Activity

Reply to watchOS play audio when screen sleeping
Hi jlilest002I tried your suggestion and another line of code :- AVAudioSession.RouteSharingPolicy.longFormAudio but unfortunately it didn't work. I am not very experienced in programming so maybe I am inserting this code in the wrong place, it's just before the code to define the audio path and "try AVAudioPlayer(contentsOf: urlPath)" let session = AVAudioSession.sharedInstance() // AVAudioSession.RouteSharingPolicy.longFormAudio do { // try AVAudioSession.session.RouteSharingPolicy.longFormAudio try session.setCategory(AVAudioSession.Category.playback, mode: .default, policy: .longFormAudio, options: []) } catch let error { fatalError("*** Unable to set up the audio session: \(error.localizedDescription) ***") }Andrew
Nov ’19