Ear Monitor-related Issues
In Karaoke scenarios, ear monitoring is likely to be used. How can I enable the ear monitoring function?
[[trtcCloud getAudioEffectManager] enableVoiceEarMonitor:YES];
What if there is no effect after enabling the ear monitoring function?
Due to the high hardware latency of Bluetooth headsets, please try to prompt the host to wear wired headphones on the user interface. At the same time, please note that not all phones can achieve excellent ear monitoring effects after enabling this feature. The TRTC SDK has already blocked this effect on some phones with poor ear monitoring performance.
Is the ear monitoring latency too high?
Please check if you are using a Bluetooth headset. Due to the high hardware latency of Bluetooth headsets, please try to use wired headphones as much as possible.
In addition, you can try to improve the high latency of ear monitoring by enabling hardware ear monitoring through the experimental interface setSystemAudioKitEnabled. Currently, for Huawei and Vivo devices, the SDK uses hardware ear monitoring by default, while other devices use software ear monitoring by default.
// Enable hardware ear monitoring
NSDictionary *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];
NTP Time Synchronization Issues
Reminder: “NTP time sync finished, but result maybe inaccurate”?
NTP time synchronization is successful, but the deviation may be more than 30ms, reflecting poor client network environment and continuous rtt jitter.
Reminder: “Error in AddressResolver: No address associated with hostname”?
NTP time synchronization failure may be due to temporary anomalies in the local carrier DNS resolution under the current network environment. Please try again later.
NTP service retry processing logic?
Network Speed Test Recommendations
Online Karaoke scenarios have high network requirements for users, especially real-time chorus. A high-quality and stable network environment is necessary for a good Karaoke experience. Therefore, it is recommended to perform a network speed test on the user before entering the room, and give a UI layer reminder to users who do not meet the network requirements, prohibiting them from joining the Karaoke room or participating in chorus.
Initiating network speed test with TRTC SDK:
TRTCSpeedTestParams *speedTestParams = [[TRTCSpeedTestParams alloc] init];
speedTestParams.sdkAppId = SDK_APP_ID;
speedTestParams.userId = userId;
speedTestParams.userSig = userSig;
speedTestParams.expectedDownBandwidth = 3000;
speedTestParams.expectedUpBandwidth = 3000;
[trtcCloud startSpeedTest:speedTestParams];
Note:
Expected upstream bandwidth, ranging from 10 to 5000 kbps
Please perform the network speed test before entering the room. Network speed testing in the room will affect the normal audio and video transmission effects, and due to too much interference, the network speed test results will also be inaccurate.
TRTC SDK network speed test result callback:
- (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]];
}
}
Joining a Chorus Midway
The real-time chorus solution theoretically has no limit on the number of chorus participants, supporting multiple people to participate in the chorus simultaneously, as well as joining the chorus midway.
The following are the key actions for joining a chorus midway:
NTP time synchronization
Enable chorus experimental interface
Enter the room and start streaming on the microphone
Receive chorus signaling, obtain accompaniment resources and chorus agreed time
Calculate the difference between the agreed time and the current time, preload and seek accompaniment
Start participating in the chorus and synchronize accompaniment progress and lyrics progress in real-time
Was this page helpful?