Reusing Stream Configurations

There are often times when you want to reuse a stream configuration object from an existing profile. You may have old profiles that need updating or you may need a stream identical to one in a system profile. It is easier to reuse stream configurations than to create new ones, and you can often change a few settings in a configuration to meet your needs rather than creating an entirely new one.

Be aware that there are limitations to how you can change stream configurations. If you change settings in the wrong way, your profile may not accept the stream configuration object. Incorrect stream configurations are frequently accepted by the profile but cause the writer object to reject the profile. Be aware of the following limitations and issues when using and modifying existing stream configurations.

  • Never alter the contents of a .prx file to change stream settings. When profiles are saved to XML strings and written to a .prx file they can be read with any text editor. Looking at a saved profile can help you understand how profiles work. However, you should never alter a .prx file in any way. Even seemingly trivial changes can invalidate the profile.
  • Several versions of the Windows Media Audio codec use the same stream configurations. If you have a stream configuration object that is configured as subtype WMMEDIASUBTYPE_WMAudioV2, WMMEDIASUBTYPE_WMAudioV7, or WMMEDIASUBTYPE_WMAudioV8, the resulting stream will be compressed with the latest Windows Media Audio codec. However, you should evaluate your needs before using an existing audio codec. Many types of files can be improved by upgrading to the latest version of the Windows Media Audio Professional codec, or the Windows Media Audio Lossless codec.
  • Never change the subtype of a stream to upgrade to a new codec. When you use the methods of IWMCodecInfo3 to obtain a stream configuration, the codec attaches some data to it that identifies the bit stream format. If you change the subtype of an existing stream configuration object, the subtype will not match the codec data. A profile with such a stream configuration will not be accepted by the writer object.
  • Do not alter the settings of compressed audio stream configurations. If the settings of an audio stream do not suit your needs, obtain a new stream configuration from the codec using the methods of IWMCodecInfo3.

Configuring Streams

Getting Stream Configuration Information from Codecs