iDevGames Forums
How can can integrate a sound bar ? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: How can can integrate a sound bar ? (/thread-1766.html)



How can can integrate a sound bar ? - Rajneesh84 - Feb 13, 2009 02:55 AM

HI All,

I need to integrate a SoundBar in my application just like as speak here.
when we start recording that sound bar appears and move as a frequency meter.
In Speak here application CALayers used.

Is there anybody to suggest me how we can do this ..
Any help will be appreciable.

Thanks,
Raj...


How can can integrate a sound bar ? - AnotherJake - Feb 13, 2009 07:07 AM

To obtain frequency you will have to access the sound data in your recording callback. For instance, if you have:

AudioBufferList *ioData

as one of the parameters of your callback, you access the audio data with something like:

*data = bufferList->mBuffers[0].mData

Whether it's float data or some other kind of data depends on how you set things up earlier. You'll have to know how to do basic audio signal processing to figure out amplitude over time and determine the zeros to determine rising and falling edges, so you can figure out the period of the wave being measured. There's no built-in frequency meter that I am aware of.

With Audio Queues, no matter how you set things up, it seems to deliver the data in bursts every half second to second, so it's not ideal for real-time. For best real-time performance you'll need to use RemoteIO, which is a bit more involved to figure out, but delivers the data using basically the same callback. This article can help you figure out RemoteIO if you have to.