TVAudioMode Enumeration

 
Microsoft DirectShow 9.0

TVAudioMode Enumeration

Specifies the mode of a TV audio control.

Syntax

typedef enum tagTVAudioMode {
    AMTVAUDIO_MODE_MONO     = 0x0001,
    AMTVAUDIO_MODE_STEREO   = 0x0002,
    AMTVAUDIO_MODE_LANG_A   = 0x0010,
    AMTVAUDIO_MODE_LANG_B   = 0x0020,
    AMTVAUDIO_MODE_LANG_C   = 0x0040,
    AMTVAUDIO_PRESET_STEREO = 0x0200,
    AMTVAUDIO_PRESET_LANG_A = 0x1000,
    AMTVAUDIO_PRESET_LANG_B = 0x2000,
    AMTVAUDIO_PRESET_LANG_C = 0x4000,
} TVAudioMode;

#define TVAUDIO_MODE_MASK 0x000000ff
#define TVAUDIO_PRESET_MASK 0x0000ff00

Members

AMTVAUDIO_MODE_MONO

Mono.

AMTVAUDIO_MODE_STEREO

Stereo.

AMTVAUDIO_MODE_LANG_A

Language A: Main audio channel.

AMTVAUDIO_MODE_LANG_B

Languag B: Secondary audio program (SAP).

AMTVAUDIO_MODE_LANG_C

Language C: Either a third language, or the main audio program plus the SAP (for example, English from one speaker and Japanese from the other speaker).

AMTVAUDIO_PRESET_STEREO

Stereo preset.

AMTVAUDIO_PRESET_LANG_A

Languag A preset.

AMTVAUDIO_PRESET_LANG_B

Language B preset.

AMTVAUDIO_PRESET_LANG_C

Language C preset.

Remarks

The TVAudioMode flags fall into two groups.

  • Bits 0 - 7: Mode flags. These flags include mono/stereo and language (A, B, or C).
  • Bits 8 and higher: Preset flags.
  • Note  The preset flags require Windows Vista or later.

The mode flags represent the tuner's current audio mode. The preset flags represent settings that can take effect in the future, if the audio signal changes. Often, the secondary audio program is not available, or is available only in mono. An applicaiton can use the preset flags to store the user's preferred language while providing a reasonble experience when that language is not available.

The following remarks describe how the IAMTVAudio methods interpret these flags.

IAMTVAudio::put_TVAudioMode:

  • If you set a mode flag, the tuner switches to that mode immediately. If the mode is not immediately available, the method fails.
  • If you set a preset flag, the driver switches to that mode immediately if possible; otherwise, the driver stores the request. If the requested mode becomes available later, the driver switches to that mode. The driver maintains the preset flags across program changes or channel changes. A preset mode fails only if the tuner cannot support that mode. It never fails due to the contents of the audio signal.

You may combine one language mode flag (AMTVAUDIO_MODE_LANG_A, AMTVAUDIO_MODE_LANG_B, or AMTVAUDIO_MODE_LANG_C) with one stereo/mono flag (AMTVAUDIO_MODE_MONO or AMTVAUDIO_MODE_STERO). Other combinations of mode flags are not valid. For example, AMTVAUDIO_MODE_LANG_A | AMTVAUDIO_MODE_LANG_B is not valid.

You may combine more than one preset flag. The driver attempts them in the following order:

  1. Language C
  2. Language B
  3. Language A
  4. Stereo

You may combine mode flags and preset flags, but you cannot combine a mode flag and a preset flag for the same language. For example, AMTVAUDIO_MODE_LANG_A | AMTVAUDIO_PRESET_LANG_A is not valid. Mode flags have priority over preset flags.

If the method fails for any reason, the state of the tuner — that is, the current mode plus the stored presets — does not change.

Except for language C, the tuner always streams the same language over both audio channels.

Example: The caller sets AMTVAUDIO_PRESET_STEREO | AMTVAUDIO_PRESET_LANG_B. Suppose the current program is available in language A with stereo or language B with mono. The driver selects language B (mono), because that flag takes precedence. Later, the program switches to a commercial that is only available in language A. The driver switches to language A, because language B is not available. When the program resumes, the driver switches back to language B.

IAMTVAudio::GetAvailableTVAudioModes: This method returns the modes that are currently available in the signal. This method never returns preset flags.

IAMTVAudio::GetHardwareSupportedTVAudioModes: This method returns all of the modes supported by the hardware, including preset modes.

IAMTVAudio::get_TVAudioMode: This method returns the current mode. This method never returns preset flags.

Requirements

  Header: Dshow.h

See Also