int error = hw_AddSample(lua_State *L, lua_ID *id, struct
hwAddSampleCtrl *ctrl, struct hwTagList *tags);
lua_ID. See Object identifiers for details. The actual sample data and format
is passed via a pointer to a struct hwAddSampleCtrl which must contain
all required information. struct hwAddSampleCtrl looks like this:
struct hwAddSampleCtrl
{
APTR Data; // [in]
int Samples; // [in]
int Channels; // [in]
int Bits; // [in]
int Frequency; // [in]
ULONG Flags; // [in]
};
|
You need to provide the following information in this structure:
Data:
Samples:Data. Note that this must be specified
in PCM frames, not in bytes.
Channels:
Bits:
Frequency:
Flags:
HWSNDFLAGS_BIGENDIAN
HWSNDFLAGS_SIGNEDINT
HWSNDFLAGS_SOFTWAREYou can free samples by calling the hw_FreeSample() function.
lua_Statestruct hwAddSampleCtrl containing the sample data and format