Swift

Implement the "Stop Ringtone" Logic

When the call connects (or the user answers), we need to stop the ringtone and hand control of the audio hardware back to the Vonage SDK.

Add these methods to your AudioDeviceRingtone class:

func stopRingtone() {
    // 1. Stop the audio player
    audioPlayer?.stop()
    audioPlayer = nil
    
    // 2. Stop vibration
    vibrateTimer?.invalidate()
    vibrateTimer = nil
    
    // 3. Resume audio
    // This hands control back to the SDK to resume the video chat audio
    _ = startCapture()
    _ = startRendering()
    
    // ...
}

Custom audio driver

Learn how to use a custom audio driver to customize publisher and subscriber stream audio. You will use the custom audio driver when you want to start and stop the audio play your own audio file, and do anything outside the default behavior of live video chat provided by the SDK.

Available on:
Kotlin Swift
Steps
1
Introduction
2
Getting Started
3
Creating a New Project
4
Adding the Vonage Video SDK
5
Setting Up Authentication
6
Overview
7
Create the Custom Audio Driver Class
8
Implement the "Play Ringtone" Logic
9
Implement the "Stop Ringtone" Logic
10
Integrate with Vonage Video Manager
11
Control audio via Session Events
12
How It Works
13
Conclusion