0

I'm creating VoIP app. I want to reduce the size of the audio file with: AVAudioPCMFormatFloat32 formatted. when I recording audio with handsfree and compressed the leaner PCM is good and reduced size but when I record with main-mic compressor not affect the PCM file size!!

Is there a way to reduce the quality of recorded audio to reduce size?

In addition, in use the AVfoundation:

-(void)setupAVRecorder {
    // Setting up audio engine for local recording and sounds

    localInput = localAudioEngine.inputNode;
    [localAudioEngine attachNode:localAudioPlayer];
    //        self.localInputFormat = self.localInput?.inputFormat(forBus: 0)

    localInputFormat = [[AVAudioFormat alloc]initWithCommonFormat:AVAudioPCMFormatFloat32 sampleRate:44100 channels:1 interleaved:false];
    [localAudioEngine connect:localAudioPlayer to:localAudioEngine.mainMixerNode format:localInputFormat];




       dispatch_sync(audioPlayerQueue, ^{
        peerInput = peerAudioEngine.inputNode;
        [peerAudioEngine attachNode:peerAudioPlayer];

        peerInputFormat = [[AVAudioFormat alloc]initWithCommonFormat:AVAudioPCMFormatFloat32 sampleRate:44100 channels:1 interleaved:false];
        [peerAudioEngine connect:peerAudioPlayer to:peerAudioEngine.mainMixerNode format:peerInputFormat];

        //            self.peerInputFormat = self.peerInput?.inputFormat(forBus: 1)

    });


}
Sulthan
  • 128,090
  • 22
  • 218
  • 270
ehsan
  • 91
  • 1
  • 5
  • reduce the sample rate? `44100` is CD quality. See https://wiki.audacityteam.org/wiki/Sample_Rates to see what sample rate mans. – Sulthan Mar 10 '18 at 09:08
  • @Sulthan I use anything other than 44100, I encounter an error: `Thread 1: signal SIGABRT` – ehsan Mar 10 '18 at 10:12

0 Answers0