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 / protoSoundFrame


SetRecordingLength

soundFrame:SetRecordingLength(numSamples, Callback)

Sets the length of the VBO holding the recorded sound samples.

numSamples
An integer expressing the number of samples to include in the VBO stored in the samples slot of the sound frame.

Callback
A callback function that you provide, and that is executed when the SetLength operation on the VBO is completed. This function may be necessary for an interface in which the user can switch rapidly from recording to playback. This slot may hold the value nil or a callback function that takes no parameters. Its return value is not used.

return value
Undefined; do not rely on it.

DISCUSSION

You should call *SetRecordingLength after the user stops recording sound input. This method sets the length slot in the sound frame to the numSamples value, then it uses an AddDeferredSend call to truncate the length of the VBO to that same value (multiplied by the size of each sample in bytes).

Since the methods *GetPlayingTime and *GetSampleCount rely on the length slot, both return correct values immediately after *SetRecordingLength has been called.


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