TAudioMixer Properties


FgPlaying : Boolean;

Read only

Use this property in amRTMix mode to check if the forground sound is currently playing.


Input1 : TACSInput;

Use this property to set the first input stream to be mixed.


Input2 : TACSInput;

Use this property to set the second input stream to be mixed.


Mode : TAudioMixerMode;

This property sets the mode for the TAudioMixer. The possible values for this property are amMix, amConcatenate, amRTMix. If it is set to amMix (default) the mixer mixes input streams and the size of the resulting stream is equal to the size of longest input stream. If this property is set to amConcatenate, the two streams are concatenated together and the size of the resulting stream is the sum of the sizes of the input streams. When the mode is amConcatenate the stream from the Input1 is put before the stream from the Input2.

In amRTMix mode you can add Input2 (forground) to Input1 (background) at any time while the mixer is playing. To add forground sound to the background just assign an input to Input2 property. Note the following: after forground sound is done with the Input2 pointer becomes nil. The total length of the playback is equal to the background sound length, with any forground sound still playing being aborted. You can assign new forground sound while another forground sound is playing (in which case the new sound will replace the old one) but you cannot use the same input component in this case. When the AudioMixer is playing you can tell if the forground sound is playing by checking the value of FgPlaying property. The following code illustrates this:

var
  InputVar1 : TACSInput;
  InputVar2 : TACSInput;
begin
  AudioMixer1.Input2 := InputVar1;
  ...
  if AudioMixer1.FgPlaying then 
  AudioMixer1.Input2 := InputVar2; // Cannot assign InputVar1 here
  ...
  if not AudioMixer1.FgPlaying then 
  AudioMixer1.Input2 := InputVar2; // Can assign the same input component again


Volume1 : Integer;

Use Volume1 to set the volume of the first stream in the resulting mixed stream. The maximum value is 255 (default) the minimum value is 0.


Volume2 : Integer;

Use Volume2 to set the volume of the second stream in the resulting mixed stream. The maximum value is 255 (default) the minimum value is 0.


TAudioMixer ACS Classes Home


Copyright © 2002, 2003 Andrei Borovsky. All rights reserved.