Re: Reading and writing from/to sound devices without AU
Re: Reading and writing from/to sound devices without AU
- Subject: Re: Reading and writing from/to sound devices without AU
- From: Rick Mann <email@hidden>
- Date: Thu, 10 Mar 2011 00:34:25 -0800
On Mar 9, 2011, at 23:40:21, Ian Kemmish wrote:
>
> On 9 Mar 2011, at 19:18, Rick Mann <email@hidden> wrote:
>
>> I already wrote some code as an Audio Unit, and that works fine. But there are times when I want to process the incoming data (which happens to be in the audio spectrum, of sorts, but isn't necessarily audio data) and produce something that is distinctly NOT audio. In this case, I won't be outputting any sounds, and Core Audio won't be calling me to ask for samples.
>
>
> So the audio stream is multiplexed with out of band data?
No, I think you misunderstand. There are numerous schemes for modulating digital data (say, a short text message) on an RF carrier. The data is usually very low bandwidth, and fits in a typical audio spectrum. My could would take in this modulated audio and demodulate it, recovering the original text message. It may, optionally, also send the undemodulated audio out to the speaker so it can be heard at the same time (it would sound something like an old modem.
Sometimes what's encoded in the RF carrier is an audio signal you want to hear directly (someone's voice, or morse code, or whatever). For this, Audio Units are probably the right way to go.
>
> To handle the data, I'd buffer it up in the AU, and send a notification to the host that some data is ready. (Or have the host poll if the exact timing isn't critical.)
>
> As for the rest, I can see two scenarios:
>
> 1) The audio stream is continuous, and the data is merely interpolated in it. In that case, your Au simply keeps reading samples from your device until it has filled the audio buffer which CoreAudio has asked it to fill.
>
> 2) The audio stream is to be muted while the data is being received. In that case you just fill the buffer with zeroes.
>
>
> How gracefully your device works if it's not immediately connected to your AU, or your AU works if it's not immediately downstream of your device, well, that's up to you....
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Ian Kemmish 18 Durham Close, Biggleswade, Beds SG18 8HZ
> email@hidden Tel: +44 1767 601361 Mob: +44 7952 854387
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>
_______________________________________________
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