[[trtcCloud getAudioEffectManager] enableVoiceEarMonitor:YES];
// Enable hardware ear monitoringNSDictionary *jsonDic = @{@"api": @"setSystemAudioKitEnabled",@"params": @{@"enable": @(1)}};NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic options:NSJSONWritingPrettyPrinted error:nil];NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[trtcCloud callExperimentalAPI:jsonString];

TRTCSpeedTestParams *speedTestParams = [[TRTCSpeedTestParams alloc] init];speedTestParams.sdkAppId = SDK_APP_ID;speedTestParams.userId = userId;speedTestParams.userSig = userSig;// If the actual bandwidth is higher than the expected value, the test result is the expected value;// if the actual bandwidth is lower than the expected value, the test result is the actual bandwidth value.speedTestParams.expectedDownBandwidth = 3000; // Expected downstream bandwidth, ranging from 10 to 5000 kbpsspeedTestParams.expectedUpBandwidth = 3000; // Expected upstream bandwidth, ranging from 10 to 5000 kbps[trtcCloud startSpeedTest:speedTestParams];
- (void)onSpeedTestResult:(TRTCSpeedTestResult *)result {NSString *tquality = @"Unknown";switch (result.quality) {case TRTCQuality_Unknown:tquality = @"Unknown";break;case TRTCQuality_Excellent:tquality = @"The current network is excellent";break;case TRTCQuality_Good:tquality = @"The current network is good";break;case TRTCQuality_Poor:tquality = @"The current network is poor";break;case TRTCQuality_Bad:tquality = @"The current network is bad";break;case TRTCQuality_Vbad:tquality = @"The current network is very bad";break;case TRTCQuality_Down:tquality = @"The current network does not meet TRTC\\`s minimum requestments";break;default:break;}if (result.success) {[mTextTestResult addObject:@"test successfull!\\n"];[mTextTestResult addObject:[NSString stringWithFormat:@"IP address:%@ \\n", result.ip]];[mTextTestResult addObject:[NSString stringWithFormat:@"uplink packet loss rate:%f \\n", result.upLostRate]];[mTextTestResult addObject:[NSString stringWithFormat:@"downlink packet loss rate:%f \\n", result.downLostRate]];[mTextTestResult addObject:[NSString stringWithFormat:@"network lantency:%u ms \\n", result.rtt]];[mTextTestResult addObject:[NSString stringWithFormat:@"downlink bandwidth:%ld kbps \\n", (long)result.availableDownBandwidth]];[mTextTestResult addObject:[NSString stringWithFormat:@"uplink bandwidth:%ld kbps \\n", result.availableUpBandwidth]];[mTextTestResult addObject:[NSString stringWithFormat:@"downlink bandwidth:%@ \\n", tquality]];} else {[mTextTestResult addObject:@"test successfull!\\n"];[mTextTestResult addObject:[NSString stringWithFormat:@"errMsg:%@ \\n", result.errMsg]];}}
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback