Martifan 5 Posted August 27, 2020 Hello Please tell me how to check the silent mode on the iPhone or not? any ideas thank you in advance Share this post Link to post
pyscripter 689 Posted August 28, 2020 See https://github.com/akramhussein/Mute Share this post Link to post
Martifan 5 Posted August 28, 2020 2 minutes ago, pyscripter said: See https://github.com/akramhussein/Mute thanks for the answer sorry did not indicate I need example to Delphi Share this post Link to post
Rollo62 536 Posted August 28, 2020 The "trick" here seems just to play, and measure the time. private func playSound() { ... self.interval = Date.timeIntervalSinceReferenceDate //<==== Measure before AudioServicesPlaySystemSoundWithCompletion(self.soundId) { [weak self] in self?.soundFinishedPlaying() //<==== Start playing } ... } /// Called when AudioService finished playing sound private func soundFinishedPlaying() { self.isPlaying = false let elapsed = Date.timeIntervalSinceReferenceDate - self.interval //<==== Measure elapsed time let isMute = elapsed < 0.1 //<==== !! Decide here whether it was muted or not ... } Share this post Link to post