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
<http://stackoverflow.com/questions/34714832/writing-bytes-to-audio-file-using-auhal-audio-unit>.
And any code in my one main file that I did list there would be in this
Gist. <https://gist.github.com/AlexanderBollbach/2dbf971775c1fde985c0>
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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com
This email sent to [email protected]