ImageEn, unit iemmf

TIEMediaFoundationSourceReader.SetMediaTypeAudio

TIEMediaFoundationSourceReader.SetMediaTypeAudio


Declaration

function SetMediaTypeAudio(streamIndex: integer; const subTypeStr: WideString): boolean;
function SetMediaTypeAudio(const subTypeStr: WideString): boolean;


Description

Creates and selects a new audio media type. Media Foundation will provide a decoder to convert from native media type.
Returns False if the media type is not accepted (or a suitable conversion is not available).

Parameter Description
streamIndex Index of the stream, in the range of 0 to StreamCount - 1
streamType A string representing the stream type. Only the first stream of this type will be considered. Can be any one of the values accepted by GetStreamType
subTypeStr Specifies the audio subtype

Audio subtypes are: 'PCM', 'Float', 'DTS', 'Dolby_AC3_SPDIF', 'DRM', 'WMAudioV8', 'WMAudioV9', 'WMAudio_Lossless', 'WMASPDIF', 'MSP1', 'MP3', 'MPEG', 'AAC', 'ADTS'


Example

audioStreamIndex := ImageEnView1.IO.MediaFoundationSourceReader.IndexOfFirstStream(mmf_AUDIO_STREAM);
ImageEnView1.IO.MediaFoundationSourceReader.SetSelectedStreams(audioStreamIndex, true);
ImageEnView1.IO.MediaFoundationSourceReader.SetMediaTypeAudio(audioStreamIndex, 'PCM');
ImageEnView1.IO.MediaFoundationSourceReader.PushNotifyReceiver( TIEMediaFoundationAudioRenderer.Create(audioStreamIndex) );


See Also

 GetMediaType
 GetMediaTypesCount
 SetMediaTypeCustom
 SetMediaTypeVideo
 SelectMediaType
 GetCurrentMediaType