trtc音质优化

This commit is contained in:
chenguilong
2022-11-18 16:01:42 +08:00
parent 5975c25682
commit f370f3afc9

View File

@@ -103,7 +103,11 @@
- (void)broadcast:(BOOL)on {
[self.engine switchRole:on ? TRTCRoleAnchor : TRTCRoleAudience];
if (on) {
[self.engine startLocalAudio:TRTCAudioQualityDefault];
NSString *jsonString = @"{\"api\":\"setAudioQualityEx\",\"params\":{\"sampleRate\":48000,\"channel\":2,\"bitrate\":192,\"encodeMode\":1,\"systemVolumeType\":1}}";
[self.engine callExperimentalAPI:jsonString];
NSString *aecString = @"{\"api\":\"enableAudioAEC\",\"params\":{\"enable\":1,\"level\":100}}";
[self.engine callExperimentalAPI:aecString];
[self.engine startLocalAudio:TRTCAudioQualityMusic];
} else {
[self.engine stopLocalAudio];
}