Name
WriteSampleStream -- write sound data to sample stream (V11.0)
Synopsis
int error = WriteSampleStream(APTR handle, struct SaveSampleCtrl *ctrl);
Function
This function is optional and must only be implemented if the HWEXT_SAVESAMPLE_STREAM extension bit has been set. See Extension plugins for details. In that case, Hollywood will call this function to write more sound data to a sample stream that has been created by BeginSampleStream().

The sound data to write to the sample stream will be passed in the pointer to a struct SaveSampleCtrl to this function. See BeginSampleStream for a description of the structure.

WriteSampleStream() will only use the following structure members:

Data:
This contains the raw PCM data to write to the sample stream.

DataSize:
This contains the size of the Data buffer in bytes.

Samples:
The total number of PCM frames to save. Note that this is specified in PCM frames, not in bytes.

This function has to return 0 if the data could was successfully written or an error code.

Inputs
handle
sample stream handle created by BeginSampleStream()
ctrl
pointer to a struct SaveSampleCtrl containing the sample data
Results
error
error code or 0 for success

Show TOC