DemoGL::Reference::Functions::DEMOGL_SoundSystemSetChannelAttributes

DEMOGL_SoundSystemSetChannelAttributes

DEMOGL_SoundSystemSetChannelAttributes sets attributes like volume, panning and frequency of the given channel. Will not have any effect on channels playing data owned by elements which are loaded with 3D enabled. Use DEMOGL_SoundSystemSetChannel3DAttributes for those channels. DemoGL uses logaritmic scaling for volumes and pans.

int
DEMOGL_SoundSystemSetChannelAttributes(
	const int iChannelCodeID, 
	const int iVolume, 
	const int iPan, 
	const int iFrequency, 
	const int iWhat
);
	
Parameters.
iChannelCodeID
Specifies the ChannelCodeID of the channel which attributes should be set.
iVolume
Specifies the volume of the sound the channel produces. Values have to fall in the range [0, 100], with 0 is total silence and 100 is maximum volume. When -1 is specified the current volume value is left untouched, but this is not necessary, just set iWhat to the right value.
iPan
Specifies the panning of the channel in 2D. Values have to fall in the range [-100, 100], with -100 will place the channel totally on the left speaker and 100 will place the channel totally on the right speaker. When -101 is specified the current panning value for this channel is left untouched, but this is not necessary, just set iWhat to the right value.
iFrequency
The frequency of the output of the channel. Values have to fall in the range [100, 100000] with 100 the minimum value and 100000 the maximum value. When 0 is specified the original frequency of the channel when it was created is restored. When -1 is specified, the current value for the frequency is left untouched, but this is not necessary, just set iWhat to the right value. This value is not recommended for DGL_SS_MP3ELEMENT and DGL_SS_MODELEMENT sound element based channels.
iWhat
Specifies what to update of the attributes passed. iWhat is a collection of one or more of these values:

iWhat value Description
DGL_SS_SA_FREQUENCY Set frequency with the value in iFrequency
DGL_SS_SA_VOLUME Set volume with the value in iVolume
DGL_SS_SA_PAN Set panning with the value in iPan

Return values.
If the function succeeds, it returns SYS_OK.
If the function fails, it returns SYS_NOK.

Remarks.
This function will only have effect when the element which owns the data playing on the channel is loaded with 3D enabled.

Example.
// Set frequency of channel with id iChannelCodeID to frequency 44100hz and pan
// to the total right.
iResult = DEMOGL_SoundSystemSetChannelAttributes(
		iChannelCodeID, -1, 100, 44100, DGL_SS_SA_FREQUENCY | DGL_SS_SA_PAN);

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_SoundSystemSetChannel3DAttributes, DEMOGL_SoundSystemLoadElement

Last changed on 18-jan-2001

©1999-2001 Solutions Design