File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
LinkSDKDemo/Video/P2P/Controller Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ - (void)getDeviceStatusWithType:(NSString *)singleType qualityType:(NSString *)q
264264 TIoTCoreAudioConfig *audio_config = [TIoTCoreAudioConfig new ];
265265 audio_config.refreshSession = NO ;
266266 audio_config.sampleRate = TIoTAVCaptionFLVAudio_16;
267- audio_config.channels = 2 ;
267+ audio_config.channels = 1 ;
268268 audio_config.isEchoCancel = NO ;
269269 audio_config.pitch = tt_pitch; // -6声音会变粗一点; 6声音会变细一点
270270
Original file line number Diff line number Diff line change @@ -96,8 +96,12 @@ - (void)resumeRTCAudioSession {
9696 if (@available (iOS 10.0 , *)) {
9797 categoryOptions |= AVAudioSessionCategoryOptionAllowBluetooth;
9898 }
99- [[AVAudioSession sharedInstance ] setCategory: AVAudioSessionCategoryPlayAndRecord withOptions: categoryOptions error: nil ];
100- [[AVAudioSession sharedInstance ] setActive: YES error: nil ];
99+ AVAudioSession *session = [AVAudioSession sharedInstance ];
100+ [session setCategory: AVAudioSessionCategoryPlayAndRecord withOptions: categoryOptions error: nil ];
101+ // [session setPreferredSampleRate:16000 error:nil];
102+ // [session setPreferredInputNumberOfChannels:1 error:nil];
103+ // [session setPreferredIOBufferDuration:0.064 error:nil]; //16000*0.032*2=1024字节
104+ [session setActive: YES error: nil ];
101105 }
102106}
103107// 功能结束时重置audioSession,重置到缓存的audioSession设置
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ -(void)encodePCMData:(NSData *)pcmdata {
127127 ConverterContext *cxt = self->convertContext ;
128128 if (cxt && cxt->converter ) {
129129
130- dispatch_async (encodeQueue, ^{
130+ // dispatch_async(encodeQueue, ^{
131131
132132 NSUInteger pcmLength = pcmdata.length ;
133133 void *pcmData = pcmdata.bytes ;
@@ -168,7 +168,7 @@ -(void)encodePCMData:(NSData *)pcmdata {
168168 free (outputBuffer);
169169 outputBuffer = NULL ;
170170 }
171- });
171+ // });
172172 }
173173}
174174
You can’t perform that action at this time.
0 commit comments