Hi Jeff,
That’s pretty helpful!
Thanks!
Actually I need to do this
applet to debug an issue of missing samples while playback music. What I want
it to send value 0-65536 to the driver then it’s easier to find which samples
will be skipped.
Our customer gave me
another way to do that. Write a binary file with 0-65536 in it and use Audacity to convert it to WAV
file. That works and easier. So temporarily this issue isn’t the fist priority.
I’ll go back to it after the project has been done. Maybe at that time I’ll
bother you pretty much. J
Sincerely yours,
David Tan
Dextrys Co., Ltd.
From:
coreaudio-api-bounces+david.tan=email@hidden
[mailto:coreaudio-api-bounces+david.tan=email@hidden] On Behalf Of Jeff Moore
Sent: 2009年1月7日
4:16
To: CoreAudio-API Mailing List
Subject: Re: How to transmit
customized data to IOAudioFamily
If you want your device to be able to receive some
kind of data that is non-standard, then you have to set your driver up properly
to do that. This means that you need to make sure that the format of your
streams is all set correctly and is using a unique format ID. If this data
can't be mixed, you'll also need to be sure set the non-mixable flag in the
format.
Once your device is advertising that it accepts a
custom format, it is up to you to write the code to shovel the data to the
device as I don't believe that we have any sample code that shows how
to send non-linear PCM data to a device.
Basically, the key thing to keep in mind is that IOAudio/HAL
only support constant bit rate formats. This means that all the packets of data
have to be the same size. Further, the HAL will only do IO in single packet
buffers. This means that each call to the IOProc is expected to produce exactly
one packet of the non-linear PCM formated data.
This is just the overview of what's involved. I'm sure
as you dig into the problem you'll have more questions, so feel free to ask.