TVAudioMode enumeration (strmif.h)
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Specifies the mode of a TV audio control.
Syntax
typedef enum tagTVAudioMode {
AMTVAUDIO_MODE_MONO = 0x1,
AMTVAUDIO_MODE_STEREO = 0x2,
AMTVAUDIO_MODE_LANG_A = 0x10,
AMTVAUDIO_MODE_LANG_B = 0x20,
AMTVAUDIO_MODE_LANG_C = 0x40,
AMTVAUDIO_PRESET_STEREO = 0x200,
AMTVAUDIO_PRESET_LANG_A = 0x1000,
AMTVAUDIO_PRESET_LANG_B = 0x2000,
AMTVAUDIO_PRESET_LANG_C = 0x4000
} TVAudioMode;
Constants
AMTVAUDIO_MODE_MONO Value: 0x1 Mono. |
AMTVAUDIO_MODE_STEREO Value: 0x2 Stereo. |
AMTVAUDIO_MODE_LANG_A Value: 0x10 Language A: Main audio channel. |
AMTVAUDIO_MODE_LANG_B Value: 0x20 Languag B: Secondary audio program (SAP). |
AMTVAUDIO_MODE_LANG_C Value: 0x40 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 Value: 0x200 Stereo preset. |
AMTVAUDIO_PRESET_LANG_A Value: 0x1000 Languag A preset. |
AMTVAUDIO_PRESET_LANG_B Value: 0x2000 Language B preset. |
AMTVAUDIO_PRESET_LANG_C Value: 0x4000 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.
The following remarks describe how the IAMTVAudio methods interpret these flags.
- 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 more than one preset flag. The driver attempts them in the following order:
- Language C
- Language B
- Language A
- Stereo
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.
Mask Constants
The following constants are defined in Strmif.h:#define TVAUDIO_MODE_MASK 0x000000ff
#define TVAUDIO_PRESET_MASK 0x0000ff00
You can use TVAUDIO_MODE_MASK to select mode flags and TVAUDIO_PRESET_MASK to select preset flags:
C++ |
---|
DWORD ModeFlags(DWORD AudioMode) { return AudioMode & TVAUDIO_MODE_MASK; } |
Requirements
Requirement | Value |
---|---|
Header | strmif.h (include Dshow.h) |