I want To run dial voice when call is ringing (#508)
Unknown opened 3 years ago

I have a problem with… A clear and concise description of what the problem is.

Details (please complete the following information):

  • Tigase version: [e.g. 8.1.0]
  • JVM flavour and version [e.g. AdoptOpenJDK11]
  • Operating system/distribution/version [e.g. Linux Ubuntu 20.04]

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

issue 1 of 1
Type
Question
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#508
Please wait...
Page is in error, reload to recover