MakeSample

Makes a sample from memory (OBSOLETE)

Synopsis

Item MakeSample( uint32 NumBytes, TagArg *TagList )

Description

This function call is OBSOLETE. Use CreateSample() instead.

This function makes a sample without loading data from disk. It allocates a sample data buffer of the specified size and then defines that buffer as a sample using the parameters specified in the tag argument list. A task can write any data it cares to in the sample buffer; a sampled sound instrument can then play that data from the buffer.

When you finish with the sample, you should call UnloadSample() to deallocate its resources.

See the SetAudioItemInfo() and the Music Programmer's Guide for a list of supported tags.

See the test program ta_makesample.c for an example.

Arguments

NumBytes
Amount of memory to be allocated. Set to zero if you already have a sample in memory that you want to define using this call.
TagList
A pointer to an array of tag arguments. The last element of the array must be the value TAG_END. If there are no tag arguments, this argument must be NULL. For a list of possible tag arguments for samples, see SetAudioItemInfo() and the description of MakeSample() in the Music Programmer's Guide.

Return Value

The function returns a Sample Item number (a positive value) if successful or an error code (a negative value) if an error occurs.

Implementation

Folio call implemented in Audio folio V20.

Notes

THIS FUNCTION IS CONSIDERED OBSOLETE. Use CreateSample() instead.

Associated Files

audio.h

See Also

UnloadSample(), CreateSample()