Audio Mixer

From AVObjects Knowledge Base
Revision as of 23:33, 14 March 2007 by 81.5.93.15 (Talk)
Jump to: navigation, search

DirectShow filter specification

Audio mixer is a standard DirectShow filter.

Number of input pins >= 1 (new pin will be added after connection of all free input pins). Number of output pins >= 1 (new pin will be added after connection of all free output pins). Input/output media type: MEDIATYPE_Audio, MEDIASUBTYPE_PCM, FORMAT_WaveFormatEx.

Parameters of format:

WAVEFORMATEX: wFormatTag=WAVE_FORMAT_PCM WAVEFORMATEX: nSamplesPerSec, wBitsPerSample: the same for all inputs/outputs. WAVEFORMATEX: nChannels: 1 or 2 (mono or stereo). Can be different for different input/output pins.

Each input channel can be mixed with second channel of the same pin (for stereo inputs) or with any channel of another input pin (or several input pins). Input channels can be switched on another output pin in play time also (without graph stop).

Notes.

   - all input frequencies should be identical (resampling not implemented: 

possible in next versions)

   - after start of graph you can't change media type of output pins 

(mono->stereo and vice versa).

The filter will have a COM interface and property page for set/get parameters of mixing (Input/channel -> Output/channel).

GraphEdit registration categories

You can see filter in GraphEdit:

DirectShow Filters -> MediaLooks AudioMixer MediaLooks Filters -> MediaLooks AudioMixer

GraphEdit usage instructions

Render two (or more) media files in GraphEdit. Connect uncompressed outputs to the inputs of the Audio Mixer and render one or more output pins (AM Out) of the Audio Mixer.

Open the property page of the Audio Mixer. The selector on the left shows the rendered output pins - if you have rendered only one one output pin, only "AM Out 01" is displayed.

The grid matrix on the right defines what is to be output to the selected output pin. Values from 0 (silence - in) to 1 (original level) are accepted. In the current version an empty field will also be treated as silence. If values higher than 1 are specified, the filter will work as an amplifier.

For editing the grid - either double click or press "Space" or "F2".

For example, if you have two input stereo streams and you wish to mix these streams in such a way that both of the input left channels are mixed to the right output channel and both input right channels - to the left, and at the same time decrease the volume of each channel by 30% - this is how your grid should look like.

Personal tools