Skip to content

Commit

Permalink
录制16k杂音问题
Browse files Browse the repository at this point in the history
Change-Id: Ida178ce495d8a97040d54ec8367a5a22f4b2373a
  • Loading branch information
tonychanchen committed Nov 3, 2023
1 parent 4905f8e commit c95740c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ - (void)getDeviceStatusWithType:(NSString *)singleType qualityType:(NSString *)q

static int tt_pitch = 0;
TIoTCoreAudioConfig *audio_config = [TIoTCoreAudioConfig new];
audio_config.refreshSession = NO;
audio_config.refreshSession = YES;
audio_config.sampleRate = TIoTAVCaptionFLVAudio_8;
audio_config.channels = 1;
audio_config.isEchoCancel = YES;
Expand Down
6 changes: 3 additions & 3 deletions Source/SDK/LinkVideo/FLV/TIoTAVCaptionFLV.mm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ -(instancetype) initWithAudioConfig:(TIoTAVCaptionFLVAudioType)audioSampleRate c
_pitch = 0;
_devicePosition = AVCaptureDevicePositionBack;

_audioEncodeQueue = dispatch_queue_create("com.audio.aacencode", DISPATCH_QUEUE_SERIAL);
// _audioEncodeQueue = dispatch_queue_create("com.audio.aacencode", DISPATCH_QUEUE_SERIAL);
[self onInit];
}
return self;
Expand Down Expand Up @@ -405,7 +405,7 @@ static void record_callback(uint8_t *buffer, int size, void *u)
*/

//pcm=>aac
dispatch_async(vc.audioEncodeQueue, ^{
// dispatch_async(vc.audioEncodeQueue, ^{
static int tmpChannelDataLen = 2048;//vc.pcmRecord.pcmStreamDescription.mChannelsPerFrame * 2048;
UInt32 aaclen = [vc.pcmRecord getData:&pcm_circularBuffer :trae_aac_buffer :tmpChannelDataLen];
if (aaclen < tmpChannelDataLen) {
Expand All @@ -425,7 +425,7 @@ static void record_callback(uint8_t *buffer, int size, void *u)
NSData *data = [NSData dataWithBytes:trae_aac_buffer length:tmpChannelDataLen];
// [_fileHandle writeData:data];
[vc.aacEncoder encodePCMData:data];
});
// });
}


Expand Down

0 comments on commit c95740c

Please sign in to comment.