
TempBuffer.mDataByteSize = FRAME_SIZE * 2 Practice learns the buffers used contain 512 frames, if this changes it will be fixed in processAudio. Allocate our own buffers (1 channel, 16 bits per sample, thus 16 bits per frame, thus 2 bytes per frame). Disable buffer allocation for the recorder (optional - do this if we want to pass in our own)

KAudioOutputUnitProperty_SetInputCallback,ĬallbackStruct.inputProc = playingCallback Status = AudioComponentInstanceNew(inputComponent, &rioUnit) ĪudioFormat.mFormatID = kAudioFormatLinearPCM ĪudioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger |ĬallbackStruct.inputProc = recordingCallback

XThrowIfError(AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, propListener, self), "couldn't set property listener") ĭesc.componentType = kAudioUnitType_Output ĭesc.componentSubType = kAudioUnitSubType_RemoteIO ĭesc.componentManufacturer = kAudioUnitManufacturer_Apple ĪudioComponent inputComponent = AudioComponentFindNext(NULL, &desc)

XThrowIfError(AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory), "couldn't set audio category") UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord Status = AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration,

XThrowIfError(AudioSessionInitialize(NULL, NULL, rioInterruptionListener, self), "couldn't initialize audio session") įloat aBufferLength = 0.02 // In seconds Speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &tmp) Speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality) Here's my init audio method : #define AUDIO_QUALITY 10Įnc_state = speex_encoder_init(&speex_nb_mode) ĭec_state = speex_decoder_init(&speex_nb_mode) I'm trying to encode/decode with speex, when I do not, the audio is loud and clear, but when I encode/decode to test audio quality, I get a really poor audio quality and a robotic sound.
