Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 7 - Sound / Sound Reference
Protos / protoSoundChannel


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:

{

_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 }

DISCUSSION

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 the inputBlockSize 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help