Miles Sound System SDK 7.2a

AIL_set_sample_info

The function AIL_set_sample_info initializes a sample's address, length, type, and flags to prepare for playback of memory-resident sound data.

S32 AIL_set_sample_info(
  HSAMPLE S,
  AILSOUNDINFO const *info
);

In Parameters

S
indicates the sample to prepare for playback.
info
is a structure that contains format and address information about a sound buffer.

Returns

0 if the file could not be parsed; otherwise, a non-zero return value indicates the sample handle was successfully prepared for file playback.

Discussion

This function sets up an HSAMPLE based on the values in the AILSOUNDINFO structure. You will typically obtain a filled-out AILSOUNDINFO structure from the AIL_WAV_info function.

This function can load MPEG Layer-3 data if the format field in the AILSOUNDINFO structure is set to 85 (the standard Windows MP3 wave file id). AIL_WAV_info only parses .WAV files, so to play standard MP3 files (not .WAV-wrapped), you'll have to initialize the AILSOUNDINFO structure yourself - or just use AIL_set_named_sample_file.

It is not necessary to call AIL_init_sample, AIL_set_sample_playback_rate, or AIL_set_sample_address when using this function. The HSAMPLE is initialized automatically by the system, just as if AIL_init_sample had been called explicitly.


Group: Digital Audio Services
Related Functions: AIL_WAV_info, AIL_init_sample, AIL_set_named_sample_file, AIL_set_sample_3D_position, AIL_set_sample_address, AIL_set_sample_file, AIL_set_sample_playback_rate, AIL_start_sample
Related Basic Types: HSAMPLE, S32
Related Structures: AILSOUNDINFO
Related FAQs: How can I play two HSAMPLEs from the same memory address?, How do I play a digital sound?, How do I set a DSP filter on a sample?, How do I use multi-channel sound output in Miles?, What's the best way to port my older Miles application to MSS 7?, When can I free the memory I gave to MSS?

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.