Question about afrecord.cpp
Question about afrecord.cpp
- Subject: Question about afrecord.cpp
- From: Stan Jou <email@hidden>
- Date: Thu, 8 Jul 2004 16:34:26 -0400
Hi everyone,
First of all, the AudioFileTools example in CoreAudioSDK 1.3.1
compiles and runs on my PB 12" (latest model)/OS X 10.3.4/Xcode 1.2.
(, after fixing some private/protected methods to public...)
So I tried to modify it for my own use.
By the way, the input of sound pane in System Preferences
is set to Internal Microphone.
Here comes the problem:
In CoreAudio/Services/AudioFileTools/afrecord.cpp,
the sampling rate is set (?) in a line
dataFormat.mSampleRate = 44100.; // later get this from the hardware
When I changed 44100 to 16000,
afrecord compiles but seems not working.
It only outputs a 4096 byte file.
Another problem is that when I tried to change the line
file.Create(recordFileName, kAudioFileAIFFType);
from kAudioFileAIFFType to kAudioFileWAVEType
afrecorder compiles but doens't run with an Error shown:
Error: create audio file ('fmt?')
That part of code seems audio format settings to me,
so I'm confused why it doesn't work.
Could you please tell me where I missed or misunderstood?
Thank you,
Stan.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.