Game Development Reference
In-Depth Information
To determine the current playback status of a particular sound channel we can use
the s3eSoundChannelGetInt function as follows:
if (s3eSoundChannelGetInt(lChannel, S3E_CHANNEL_STATUS) == 1)
{
// Sound channel is currently playing
}
if (s3eSoundChannelGetInt(lChannel, S3E_CHANNEL_PAUSED) == 1)
{
// Sound channel is currently active, but paused
}
Note that this function can also be used with the S3E_CHANNEL_RATE and S3E_
CHANNEL_VOLUME properties to discover the current sample rate and volume for a
particular channel.
Finally, it is also possible to affect all currently active sound channels at once using
the functions s3eSoundPauseAllChannels , s3eSoundResumeAllChannels , and
s3eSoundStopAllChannels . These functions take no inputs and are extremely useful
for handling situations like going in and out of pause mode, or when switching
from one part of the game to another (for example, when exiting the title screen and
entering the main game).
Global sound settings
As well as being able to read and write settings on a per channel basis, we can
also make settings that affect sound support globally. To do this we use the
s3eSoundSetInt and s3eSoundGetInt functions as follows:
// To read a global sound setting
int32 lValue = s3eSoundGetInt(lProperty);
// To change a global sound setting
s3eSoundSetInt(lProperty, lValue);
Here are some of the more useful values for the lProperty parameter:
Property
Description
S3E_SOUND_VOLUME
Can be used to read or write the current master
sound volume. This will scale the volumes of each
individual channel appropriately. The maximum
value is determined by the define S3E_SOUND_
MAX_VOLUME .
Search WWH ::




Custom Search