Answer the question
In order to leave comments, you need to log in
How to embed sound when recording video from a camera to alert the user?
Default camera UIImagePickerController. At the moment the video recording starts, I want to send a sound there, which signals that the video has started to be recorded
case .right:
view.isUserInteractionEnabled = false
recordingInfoLabel.changeTextAndAnimate(text: "Please wait")
recordingWaitingTimerLabel.showTimer(seconds: Int(currentDuration))
DispatchQueue.main.async {
let play = Sound()
play.playNotificationSound()
print(play.audioPlayer as Any)
}
Timer.scheduledTimer(withTimeInterval: currentDuration, repeats: false) { (timer) in
self.stopCaptureAndTrim()
}
func playNotificationSound() {
guard let soundURL = Bundle.main.url(forResource: "reload4", withExtension: "wav") else { return }
audioPlayer = AVPlayer(url: soundURL as URL)
audioPlayer?.play()
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question