audioformat

AudioQueue callback get empty buffer on iOS 7 only

被刻印的时光 ゝ 提交于 2019-12-03 10:20:42
问题 I got a strange issue. My code works great on both iOS 5&6 but when running on iOS 7 I get empty buffers on the AudioQueue callback. Possible relevant code: - (void)setUpAudioFormat { audioFormat.mFormatID = kAudioFormatLinearPCM; audioFormat.mSampleRate = SAMPLE_RATE;//16000.0; audioFormat.mChannelsPerFrame = CHANNELS;//1; audioFormat.mBitsPerChannel = 16; audioFormat.mFramesPerPacket = 1; audioFormat.mBytesPerFrame = audioFormat.mChannelsPerFrame * sizeof(SInt16); audioFormat

AudioQueue callback get empty buffer on iOS 7 only

纵然是瞬间 提交于 2019-12-03 00:51:30
I got a strange issue. My code works great on both iOS 5&6 but when running on iOS 7 I get empty buffers on the AudioQueue callback. Possible relevant code: - (void)setUpAudioFormat { audioFormat.mFormatID = kAudioFormatLinearPCM; audioFormat.mSampleRate = SAMPLE_RATE;//16000.0; audioFormat.mChannelsPerFrame = CHANNELS;//1; audioFormat.mBitsPerChannel = 16; audioFormat.mFramesPerPacket = 1; audioFormat.mBytesPerFrame = audioFormat.mChannelsPerFrame * sizeof(SInt16); audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame * audioFormat.mFramesPerPacket; audioFormat.mFormatFlags =

Recording mp3 instead of caf file

孤人 提交于 2019-12-02 10:28:56
I'm looking at this example: https://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html I modified it ( the AQRecorder.mm)to record mp3 instead of caf file. I changed from kAudioFileCAFType to kAudioFileMP3Type but it does not create the file. The code became void AQRecorder::SetupAudioFormat(UInt32 inFormatID) { memset(&mRecordFormat, 0, sizeof(mRecordFormat)); UInt32 size = sizeof(mRecordFormat.mSampleRate); XThrowIfError(AudioSessionGetProperty( kAudioSessionProperty_CurrentHardwareSampleRate, &size, &mRecordFormat.mSampleRate), "couldn't get hardware sample rate"

How to write array of float values to audio file in Core Audio?

故事扮演 提交于 2019-12-02 09:20:20
问题 I am trying to implement linear convolution using Core Audio, I have the algorithm implemented and working, but I am trying to write the output of this into a .wav audio file. Here is the code for the algorithm... //Create array containing output of convolution (size of array1 + array2 - 1) float *COutput; COutput = (float *)malloc(((size1+size2)-1)* sizeof(float)); int sizeOutput = ((size1 + size2)-1); //Convolution Algorithm!!! for (i=0; i<sizeOutput; i++) { COutput[i]=0; for (j=0; j

How to write array of float values to audio file in Core Audio?

a 夏天 提交于 2019-12-02 04:00:22
I am trying to implement linear convolution using Core Audio, I have the algorithm implemented and working, but I am trying to write the output of this into a .wav audio file. Here is the code for the algorithm... //Create array containing output of convolution (size of array1 + array2 - 1) float *COutput; COutput = (float *)malloc(((size1+size2)-1)* sizeof(float)); int sizeOutput = ((size1 + size2)-1); //Convolution Algorithm!!! for (i=0; i<sizeOutput; i++) { COutput[i]=0; for (j=0; j<sizeCArray1; j++) { if (((i-j)+1) > 0) { COutput[i] += CArray1[i - j] * CArray2[j]; } } } I need to write the