I have a problem with… A clear and concise description of what the problem is.
Details (please complete the following information):
Hello i am working on application but when i try to play a dial voice when call is ringing it is play for second and then it is muted
here is my code that called when call is ringing
func startDialSound() { do { let session = AVAudioSession.sharedInstance() try session.setCategory(.playAndRecord, options: [.duckOthers]) let path = Bundle.main.path(forResource: "dial.wav", ofType: nil)! let url = URL(fileURLWithPath: path) self.dialPlayer = try AVAudioPlayer(contentsOf: url) self.dialPlayer?.prepareToPlay() self.dialPlayer?.numberOfLoops = -1 self.dialPlayer?.volume = 1 dialPlayer?.play() } catch {} }
i am trying to stop all audio sessions to play this song
or if there is any idea to play an audio using call itself?
please help me
thanks
I have a problem with… A clear and concise description of what the problem is.
Details (please complete the following information):
Hello i am working on application but when i try to play a dial voice when call is ringing it is play for second and then it is muted
here is my code that called when call is ringing
i am trying to stop all audio sessions to play this song
or if there is any idea to play an audio using call itself?
please help me
thanks