OTAudioDeviceManager
Use the AudioDeviceManager to set a custom audio device to be used by the app. The audio device manages access to the audio capturing and rendering hardware.
You can only define a single audio capture source and rendering target for the entire process. You cannot set these individually for each publisher and subscriber. You can, however, set the audio bitrate for a published stream by setting the [OTPublisherKitSettings audioBitrate] property.
Methods
| Name | Description |
|---|---|
(static) setAudioDevice:(device) |
Sets the audio device to be used. |
(static) currentAudioDevice() → {id<OTAudioDevice>} |
Gets the OTAudioDevice instance. |
(static) currentAudioSessionManager() → {id<OTAudioSessionManager>} |
Gets the OTAudioSessionManager instance, if the current audio device supports it. |
(static) setAudioDevice:(device)
Sets the audio device to be used.
You must call this method before you connect to a session. Additionally, this is a global operation that must persist throughout the lifetime of an application.
If you do not call this method, the app uses the iOS device's microphone and speaker.
Parameters:
| Name | Type | Description |
|---|---|---|
device |
id<OTAudioDevice> | The OTAudioDevice interface implementation. This object is retained. |
(static) currentAudioDevice() → {id<OTAudioDevice>}
Gets the OTAudioDevice instance.
Returns:
id The OTAudioDevice implementation.
(static) currentAudioSessionManager() → {id<OTAudioSessionManager>}
Gets the OTAudioSessionManager instance, if the current audio device supports it.
This returns the same instance as + currentAudioDevice if it conforms to the OTAudioSessionManager protocol. Otherwise, returns nil.
Note: Currently only the default audio device supports this protocol.
For more information, see this documentation.
Returns:
id The OTAudioSessionManager implementation, or nil if unsupported.