cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The startPlayingSoundFile function is not playing on iOS

koganiz
Contributor
Hi guys,
 
I'm implementing the SDK based on the VideoCallKitSwift swift sample.
SDK 5.23.5 dynamic, iOS 16.5.1.
Not sure if it's related, but the hosting app is in SwiftUI.
Everything looks good so far, the only problem I have is the startPlayingSoundFile function.
It's not failing, and in the log I see the line:
 
[audio-controller] Successfully played audio file at path '/private/var/containers/Bundle/Application/579036B2-938F-4708-8EF9-6BADD83546A4/test.app/ringback.wav'
 
The audio file I took from the sample folder.
Sometimes only when I stop in debugger I can hear the ring for a short while, but then it stops.
 
Any ideas?
 
Here is the code.
 do {
try AppDelegate.callKitMediator.client?.audioController.startPlayingSoundFile(withPath: Bundle.main.path(forResource: "ringback", ofType: "wav"), looping: true)
} catch {
os_log("WARNING: path for resource %{public}@ not found in the main bundle", log: self.customLog, type: .error, "ringback.wav")
}
 
 
10 REPLIES 10

babyfish0226
Occasional Contributor

Thank you, it works successfully, but the sound is coming through the phone. If I want it to play directly through the speaker, how can I do that?