Hello RubyMotion developers,
I've bumped into an issue with pointers in RubyMotion.
I'm developing an industry-specific dictation application for iOS.
I'm doing audio processing (silence detection), which means I have to work directly with raw audio data returned by the AVFoundation (Audio) API.
The AVAudioPCMBuffer.floatChannelData property has the following structure in memory:
-- data starts here in memory
Pointer to channel1 data
Pointer to channel2 data
Channel1 data (float array)
Channel2 data (float array)
-- data finishes here in memory
My question is:
How can I create a pointer to "Channel 1 data" by taking the address from "Pointer to channel 1 data"?
I know that I can create a Pointer to a float array like this:
pointer = Pointer.new(:float, size)
How can I assign an address to this pointer?
Thanks for your help, cheers: