Hi Apple,
Now I’m working on an applet which can transmit
customized samples data to my KEXT audio driver.
I found useful source code from AudioFileTools provided
at /Developer/Examples/CoreAudio/Services/AudioFileTools. It seems that “afplay”
is similar to what I expect.
After examining the source code, I thought I can replace
the actual audio data from audio file with my customized data at CAAudioFilePlayer::InputProc(). There’s
a parameter “AudioBufferList* ioData”
of this callback function.
As I understood, actual audio data will be filled into
ioData and then CAAudioFilePlayer will transfer them to KEXT audio driver via
CoreAudio.
However, after I implemented the replacement, I cannot
hear anything from the headphone. So I put a breakpoint at
IOAudioEngine::clipOutputSample() in my kernel-driver, and found that the
samples in mixbuf are always zero.
That means I cannot get customized audio data from my
applet.
Is there anything I misunderstood or missed? Any
advice and suggestion will be much appreciated. Thanks a lot!
Sincerely yours,
David Tan
Dextrys Co., Ltd