IDvdControl2::SelectAudioStream method (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.]
The SelectAudioStream
method selects the audio stream to play.
Syntax
HRESULT SelectAudioStream(
[in] ULONG ulAudio,
[in] DWORD dwFlags,
[out] IDvdCmd **ppCmd
);
Parameters
[in] ulAudio
Value that specifies the audio stream. Valid stream numbers are 0 through 7, or DVD_DEFAULT_AUDIO_STREAM to specify the default stream.
[in] dwFlags
Bitwise OR of one or more flags from the DVD_CMD_FLAGS enumeration, specifying how to synchronize the command. This parameter is currently ignored; use DVD_CMD_FLAG_None.
[out] ppCmd
Receives a pointer to an IDvdCmd object that can be used to synchronize DVD commands. The caller must release the interface. This parameter can be NULL. For more information, see Synchronizing DVD Commands.
Return value
Returns one of the following values.
Return code | Description |
---|---|
|
No default audio stream was found; or dwFlags is not zero. |
|
Success. |
|
ulAudio is out of range, or doesn't correspond to an audio stream. |
|
The ulAudio value is valid, but the DVD Navigator could not set it for some reason. |
|
UOP control prohibits the operation. |
|
The specified stream is disabled. |
Remarks
This method affects the audio of the current Video Title Set (VTS). When called from within a menu, this method sets the audio stream of the title from which the menu was called.
The following table shows the Annex J command name to which this method name corresponds, and the domains in which this method is valid.
Annex J Command Name | Valid Domains |
Audio_Stream_Change |
|
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | strmif.h (include Dshow.h) |
Library | Strmiids.lib |