Trouble recording using the AUHAL unit.
Trouble recording using the AUHAL unit.
- Subject: Trouble recording using the AUHAL unit.
- From: Alexander Bollbach <email@hidden>
- Date: Mon, 11 Jan 2016 07:08:18 +0000
I posted on stack overflow regarding trouble I am having recording files from the built-in mic on my macbook. I listed some of the code sections with an explanation of what was going wrong
on StackOverflow. And any code in my one main file that I did list there would be
in this Gist. I am simply getting terribly distorted and random files in my derived data folder. You can see I am logging out the first float32 bytes of the input callback. I confusing assignment:
Float32 someDataL = *(Float32*)(player->inputBuffer->mBuffers[0].mData);
printf("input: % 1.7f \n",someDataL);
but i believed that it would tell me if the result of the AudioUnitRender() call had placed data into my buffer that resembled what was going into my mic. And sure enough just logging out that one 4byte section in memory as a float corresponded precisely to the snapping and clapping I was doing while running the app.
I am trying to record small chunks of PCM for this beat making app I'm writing and so I figured it would be easy enough to just do AudioFileWriteBytes in this callback and multiply the number of frame with how many bytes per frame and just write it but the file winds up being a garbled mess. At this point I simply can't figure out what is wrong.. I could really use some help getting a better understanding of audio units from the community of core audio programmers.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden