SetRecordingLength
soundFrame:SetRecordingLength(numSamples, Callback)
Sets the length of the VBO holding the recorded sound samples.
DISCUSSION
- 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 valuenil
or a callback function that takes no parameters. Its return value is not used.
- return value
- Undefined; do not rely on it.
You should call *
SetRecordingLength
after the user stops recording sound input. This method sets thelength
slot in the sound frame to the numSamples value, then it uses anAddDeferredSend
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 thelength
slot, both return correct values immediately after *SetRecordingLength
has been called.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help