FuncList | DESC |
The status of a local device changed (for desktop OS only) |
FuncList | DESC |
Querying whether the front camera is being used | |
Switching to the front/rear camera (for mobile OS) | |
Querying whether the current camera supports zooming (for mobile OS) | |
Getting the maximum zoom ratio of the camera (for mobile OS) | |
Setting the camera zoom ratio (for mobile OS) | |
Querying whether automatic face detection is supported (for mobile OS) | |
Enabling auto focus (for mobile OS) | |
Adjusting the focus (for mobile OS) | |
Querying whether flash is supported (for mobile OS) | |
Enabling/Disabling flash, i.e., the torch mode (for mobile OS) | |
Setting the audio route (for mobile OS) | |
Set the exposure parameters of the camera, ranging from - 1 to 1 | |
Getting the device list (for desktop OS) | |
Setting the device to use (for desktop OS) | |
Getting the device currently in use (for desktop OS) | |
Setting the volume of the current device (for desktop OS) | |
Getting the volume of the current device (for desktop OS) | |
Muting the current device (for desktop OS) | |
Querying whether the current device is muted (for desktop OS) | |
Set the audio device used by SDK to follow the system default device (for desktop OS) | |
Starting camera testing (for desktop OS) | |
Ending camera testing (for desktop OS) | |
Starting mic testing (for desktop OS) | |
Starting mic testing (for desktop OS) | |
Ending mic testing (for desktop OS) | |
Starting speaker testing (for desktop OS) | |
Ending speaker testing (for desktop OS) | |
set onDeviceChanged callback (for Mac) | |
Setting the system volume type (for mobile OS) |
FuncList | DESC |
Audio/Video device information (for desktop OS) |
EnumType | DESC |
System volume type | |
Audio route (the route via which audio is played) | |
Device type (for desktop OS) | |
Device operation |
- (void)onDeviceChanged: | (NSString*)deviceId |
type: | |
state: |
Param | DESC |
deviceId | Device ID |
state | Device status. 0 : connected; 1 : disconnected; 2 : started |
type | Device type |
- (NSInteger)switchCamera: | (BOOL)frontCamera |
- (NSInteger)setCameraZoomRatio: | (CGFloat)zoomRatio |
Param | DESC |
zoomRatio | Value range: 1-5. 1 indicates the widest angle of view (original), and 5 the narrowest angle of view (zoomed in).The maximum value is recommended to be 5. If the value exceeds 5, the video will become blurred. |
- (NSInteger)enableCameraAutoFocus: | (BOOL)enabled |
- (NSInteger)setCameraFocusPosition: | (CGPoint)position |
Param | DESC |
position | The spot to focus on. Pass in the coordinates of the spot you want to focus on. |
- (NSInteger)enableCameraTorch: | (BOOL)enabled |
- (NSInteger)setAudioRoute: |
- (NSInteger)setExposureCompensation: | (CGFloat)value |
- (NSArray<TXMediaDeviceInfo *> * _Nullable)getDevicesList: |
Param | DESC |
type | Device type. Set it to the type of device you want to get. For details, please see the definition of TXMediaDeviceType . |
ITXDeviceCollection
object, after using this API, please call the release
method to release the resources. delete
to release the Collection object returned as deleting the ITXDeviceCollection* pointer will cause crash. type
are TXMediaDeviceTypeMic
, TXMediaDeviceTypeSpeaker
, and TXMediaDeviceTypeCamera
.- (NSInteger)setCurrentDevice: | |
deviceId: | (NSString *)deviceId |
Param | DESC |
deviceId | |
type | Device type. For details, please see the definition of TXMediaDeviceType . |
- (TXMediaDeviceInfo * _Nullable)getCurrentDevice: |
- (NSInteger)setCurrentDeviceVolume: | (NSInteger)volume |
deviceType: |
Param | DESC |
volume | Volume. Value range: 0-100; default: 100 |
- (NSInteger)getCurrentDeviceVolume: |
- (NSInteger)setCurrentDeviceMute: | (BOOL)mute |
deviceType: |
- (BOOL)getCurrentDeviceMute: |
- (NSInteger)enableFollowingDefaultAudioDevice: | |
enable: | (BOOL)enable |
Param | DESC |
enable | Whether to follow the system default audio device. true: following. When the default audio device of the system is changed or new audio device is plugged in, the SDK immediately switches the audio device. false:not following. When the default audio device of the system is changed or new audio device is plugged in, the SDK doesn't switch the audio device. |
type | Device type. For details, please see the definition of TXMediaDeviceType . |
- (NSInteger)startCameraDeviceTest: | (NSView *)view |
- (NSInteger)startMicDeviceTest: | (NSInteger)interval |
Param | DESC |
interval | Interval of volume callbacks |
- (NSInteger)startMicDeviceTest: | (NSInteger)interval |
playback: | (BOOL)playback |
Param | DESC |
interval | Interval of volume callbacks |
playback | Whether to play back the microphone sound. The user will hear his own sound when testing the microphone if playback is true. |
- (NSInteger)startSpeakerDeviceTest: | (NSString *)audioFilePath |
Param | DESC |
filePath | Path of the audio file |
- (void)setObserver: |
- (NSInteger)setSystemVolumeType: |
startLocalAudio(quality)
API in TRTCCloud
instead, which param quality
is used to decide audio quality.Enum | Value | DESC |
TXSystemVolumeTypeAuto | 0 | Auto |
TXSystemVolumeTypeMedia | 1 | Media volume |
TXSystemVolumeTypeVOIP | 2 | Call volume |
Enum | Value | DESC |
TXAudioRouteSpeakerphone | 0 | Speakerphone: the speaker at the bottom is used for playback (hands-free). With relatively high volume, it is used to play music out loud. |
TXAudioRouteEarpiece | 1 | Earpiece: the receiver at the top is used for playback. With relatively low volume, it is suitable for call scenarios that require privacy. |
Enum | Value | DESC |
TXMediaDeviceTypeUnknown | -1 | undefined device type |
TXMediaDeviceTypeAudioInput | 0 | microphone |
TXMediaDeviceTypeAudioOutput | 1 | speaker or earpiece |
TXMediaDeviceTypeVideoCamera | 2 | camera |
Enum | Value | DESC |
TXMediaDeviceStateAdd | 0 | The device has been plugged in |
TXMediaDeviceStateRemove | 1 | The device has been removed |
TXMediaDeviceStateActive | 2 | The device has been enabled |
TXMediaDefaultDeviceChanged | 3 | system default device changed |
EnumType | DESC |
deviceId | device id (UTF-8) |
deviceName | device name (UTF-8) |
deviceProperties | device properties |
type | device type |
Was this page helpful?