TIEMediaFoundationAudioRenderer
Declaration
type TIEMediaFoundationAudioRenderer = class(TInterfacedObject, IIEMediaFoundationReaderNotifyReceiver);
Description
A wrapper for the Media Foundation audio renderer.
Applications can add a
TIEMediaFoundationAudioRenderer as a notification receiver (see
PushNotifyReceiver method) in order to automatically render the audio stream.
Note:
◼Using TIEMediaFoundationAudioRenderer with
TIEMediaFoundationSourceReader may produce audio out of synchronization.
◼The Audio renderer supports only PCM or Float media types, so applications should set the appropriate media type (see example).
// Add the audio renderer
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) );
ImageEnView1.IO.MediaFoundationSourceReader.StartCapture();
// Remove the audio renderer
ImageEnView1.IO.MediaFoundationSourceReader.StopCapture();
ImageEnView1.IO.MediaFoundationSourceReader.PopNotifyReceiver();
See Also
◼PopNotifyReceiver◼PushNotifyReceiver