Swift

Getting Started

This tutorial demonstrates how to create a custom audio driver in Swift using theVonage Video iOS SDK. We will build a "Ringtone" feature where the app pauses the video chat audio to play an incoming call ringtone using AVAudioPlayer, and then resumes the chat audio once the call is connected.

Estimated completion time: 25 mins

Before you begin, ensure you have:

  • A supported version of Xcode
  • Vonage Video API credentials:
    • Application ID (kAppId)
    • Session ID (kSessionId)
    • Token (kToken)

Note: To obtain your credentials, follow the Vonage Video Getting Started Guide.

Want to skip this tutorial? You can jump to the completed iOS Swift client code in the CustomAudioDriver folder of our Swift sample app repo on GitHub. The repo includes a README with documentation for running and exploring the code.

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, and play your own audio file. When you want to do "anything" with audio, other than the SDK default behavior of live video chat, you would use custom audio drivers.

Available on:
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