NewInputBlock
soundChannel:NewInputBlock(Callback)
Creates and returns a new sound frame that has its slots set up for recording speech at the default combination of fidelity and compression.
- Callback
- A callback function that you provide, and that is called when the sound frame fills or recording stops. It must accept two parameters, state and result, as described on page 7-31.
- return value
- A sound frame ready to accept input, that looks like this:
DISCUSSION{
_proto: protoSoundFrame, samples: vbo, // size determined by inputBlockSize Callback: callback, // function specified by caller dataType: k8Bit, // eight bits per sample compressionType: kSampleMuLaw,// MuLaw encoded samplingRate: 10800, // 10K samples per second }
This method allocates a VBO and stores it in the
'samples
slot of the returned sound frame. This is where the recorded data is stored. The size of the VBO is determined by the value of theinputBlockSize
slot in the sound channel, which defaults to 65536 bytes.The sound frame returned has reasonable settings for voice recording. However, you need not rely on these specific values. If you require specific settings, override them yourself.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help